Fixed warnings about using mysql_query() result even if false - refs BT#6759