Prevent a lone search row from being deleted

Added a check in the behavior for deleting a search query that prevents the query/row from being deleted if it is the only query.