Unit tests: More assertions around closing temp dbs
Router: Fixed a hang handling DELETE /db

It also incorrectly returned 200, not 404, if db didn't exist.
Fixes #493