_setup_settings: be more robust against partial db creation

Signed-off-by: Thomas Stilwell <stilwellt@openlabs.co>
Merge pull request #587 from benemorius/db-bugfix

_setup_settings: be more robust against partial db creation