If @err or *@err is null, does nothing. Otherwise, calls g_error_free() on *@err and sets *@err to null.