MySQL(i) db collation check was not actually querying the database default collation

This patch checks the actual db collation first, and if not found falls back to the previous method of querying the first db table's first column's collation.
Issue with the previous method is that if you had a table with a field whose collation was not the same as the db's default collation the method would return the wrong result.