Discard the reference to the underlying buffer during close(), and throw…

… `ClosedDatabaseException` on subsequent database access.

As discussed briefly in pull request #7, currently clients can continue to access the database even after it has been closed. This prevents that, and should also help ensure the underlying database is garbage collected.

This pull request is against master, and conflicts trivially with pull request #7. (Whichever is merged second will require a slight modification.)