Fix race in DB.Close. Fixes #17