Fixed bug #7038: EM - sql_free_result() on non-resources fails