Fix race on couch_db:reopen/1

This fixes a minor race by opening the database before closing it. This
was never found to be an issue in production and was just caught while
contemplating the PSE test suite.
1 file changed