Close db connection after tests.

Mocha -w fails because the database connection wasn't being closed. I extended magpie with a close method that closes the current connection.