If some other process is holding open a database connection, the
database may not have been correctly upgraded to the current
Previously, this could result in new processes assuming that
the schema was upgraded, and attempting to perform queries which
fail due to the fact that the real database schema might be
This commit ensures that we detect this case, and print an appropriate
warning so that the user can take the appropriate action
(e.g. kill the offending process, or reboot the device).