Fixed assertion reported by Pavel Zotov privately, took typical measures to avoid such behavior in the future

git-svn-id: svn+ssh://svn.code.sf.net/p/firebird/code/firebird/trunk@59608 65644016-39b1-43b1-bf79-96bc8fe82c15