[ticket/11918] Make sql_freeresult() consistent across all DB drivers

Makes the cache checking consistent in sql_freeresult() for all DB drivers.
http://tracker.phpbb.com/browse/PHPBB3-11918