[ticket/12387] Cleanup *_free_result call and remove @ on that call

https://tracker.phpbb.com/browse/PHPBB3-12387

PHPBB3-12387
sqlite3 and mysqli return an object, the others a php resource. So query_id can't be integer 0.
But mssql (\phpbb\db\driver\mssql) returns true instead of a resource if no row are returned, this case needs to be checked.