Important Firebird fixes for 3.2 release

This includes the fixes discussed in [this thread](http://www.mail-archive.com/soci-users@lists.sourceforge.net/msg01490.html) with the tests for them, a fix for another problem that one of those fixes uncovered, a compilation fix for Firebird when using MSVC and another minor warning fix.

Please see commit messages of the individual commits for more information.

PS: Firebird tests (still) pass.