Fixed CORE-4224: Database replace through services API fails

git-svn-id: svn+ssh://svn.code.sf.net/p/firebird/code/firebird/branches/B2_5_Release@58632 65644016-39b1-43b1-bf79-96bc8fe82c15
Backport fix bug CORE-4225 : Server crashes when attempting to trace activity on database having a db-level trigger


git-svn-id: svn+ssh://svn.code.sf.net/p/firebird/code/firebird/branches/B2_5_Release@58634 65644016-39b1-43b1-bf79-96bc8fe82c15
Correction for fix for bug CORE-4134 : Race condition when auto-sweep is started
The patch wrongly disabled manual sweep to run when database is shutdown.
Auto sweep is still disabled to run on such database.

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