Fix #986 - Database::_sort outputs empty ORDER BY and GROUP BY clauses

Will not output ORDER BY or GROUP BY clause if given field is empty (ie. if  = array()).