Fix possible cause for spurious 500s
Fix possible cause for spurious 500s

When DB fails to be open, aptly was skipping "close" phase, so that next
request considered database to be still open (while it's closed) leading
to panic.

Fixes: #431

neolynx/aptly,smira/aptly,neolynx/aptly,adfinis-forks/aptly,neolynx/aptly,aptly-dev/aptly,adfinis-forks/aptly,aptly-dev/aptly,aptly-dev/aptly,smira/aptly,smira/aptly,adfinis-forks/aptly