Fix race when the database did not exist before starting.

This might be relevant for all automated tests of fresh builds, i.e. also
Jenkins system tests.

Tests are in dbcore/37960-db-creation-race, see git log, make check.

BugzID: 37960
Merge pull request #75 from cloudant/37960-db-creation-race

Fix race when the database did not exist before starting.