util: Check if error is not NULL before derefencing it
The old (now deprecated) regex compile flags are not supported
since glib 2.73.3 and lead to precondition checks failing
(g_return_val_if_fail (..., NULL)
)
leading to an unset GError.
Closes: #843 (closed)