Recover from panics appropriately.

## Overview

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).

/cc @snormore @mkobetic