libtorc-core: Fix a crash if startup fails
libtorc-core: Improve database error handling

- ie actually report and act on it
libtorc-core: Lock the database to the current application.

- this prevents muliple instance of Torc applications from accessing the
same settings database.
- will follow up with application specific databases, additional
warnings and command line overrides.