use !isOpen() and bail out early in all methods

There were different ways of checking the state
of the db before actually doing something:

1. Check if open and do something, else bail

if (isOpen()) {
  // Do stuff
} else {
  // Bail
}

2. Check if closed and bail, else do something

if (isClosed()) {
  // Bail
}

// Do stuff

I chose number 2 for all methods, but replaced isClosed()
with !isOpen(). The reasons for this are:

- Consistency
- Get rid of a level of indentation
- No longer internally dependent of the isClosed() method ->
  Easier to remove if we so choose.
Merge pull request #76 from rvagg/bail-out-early-in-methods

use !isOpen() and bail out early in all methods