database: Handle error while deleting uncompacted database

We never checked to ensure that the rmtree() of the old database
succeeded.

Signed-off-by: Ben Gamari <bgamari.foss@gmail.com>