Recover from panics appropriately.

This commit adds a defer handler to ensure that transactions are always closed out - even
in the event of a panic within user code. It's recommended that applications always fail
in the event of a panic but some packages such as net/http will automatically recover
which is a problem (IHMO).
Merge pull request #220 from benbjohnson/handle-panic

Recover from panics appropriately.