Return an error if Commit() is attempted on a failed transaction

This PR implements the improvement I talked about in #67.

Any comments welcome.