Fix blank result in ODBC::GetSQLError and more issues with errors/multiple result sets

It seems with MSSQL at least, SQLGetDiagField needs to be called with
record number 0 when retrieving header fields such as the error count
(even though the documentation states that the record number is
ignored). This stops SQLGetDiagField returning SQL _ERROR and thus
numfields being uninitialized.

There's also fixes for a couple more issues relating to errors and multiple sets; see lee-houghton@efad9e6b4dc5c729143b79db5480e98b66006553 for details.