Implement Database.queryToArray to work around assumption in Database.queryAllResults

Database.queryAllResults flattens the results into a single number/string if the query returns
just one row. This may have been implemented as a convenient "find" method to quickly get a
single value from the database. But it breaks when a query intended to return multiple values
just happen to return a single row because that's all the data there is in the database.