Use SEVERITY_MASK_IDX() to find the LOG_ERR index in the unit tests

Part of legacy/trac#30901 (moved), just needed a bug number.