Don't call drush_set_error in API function _drush_sql_query(); call it in command callback, drush_sql_query().