Close connections when removing DBs

Fixes #45
cbugg: close bug-964