Fixed issue with failure to begin transaction.

When the transaction call is the first thing to reach the database,
e.g. with `queueTransactionWithBlock:` or `queueTransaction:withBlock:`,
the transaction would fail because the database had not yet been opened.
Fixed issue with crashing when nil supplied as message.