Database code cleanup

- fix dropTable() and introduce tableExists()
- kill replaceDB() - this function is unused and it's implementation obviously wrong
- add method annotation OC_DB_StatementWrapper::fetchAll
- remove duplicate code in Test_DBSchema and reuse OC_DB::tableExists

https://github.com/owncloud/core/pull/8483 requires these changes - these code fragments have been extracted to reduce the change set in #8483 in order to get the failing unit tests sorted out