Fix a few holes in which JQWorker_SignalException could allow the script to terminate without properly closing the transaction, possibly leading to deadlocks.

We were experiencing an issue that when workers would be recycled that
subsequent workers were not seeing newly added jobs (or possibly new
jobs couldn't be enqueued due to failure to aquire the lock).

It seems what was happening is that due to failure of the system to
properly close out transactions in exceptional circumstances, the
connection was left open and the pg master didn't have any way to know
that the client was dead until the TCP timeout occurred, which takes
unspecified amount of time, see http://www.postgresql.org/message-id/4019ACAB.4010600@pixar.com

By cleaning up the code around exception handling to ensure that our
cleanup code runs if JQWorker_SignalException fires, that should help
reduce the surface area for this potential failure scenario.

Now that failure scenario should be limited to the client dying from
kill -9 or other hard-death scenario. I am presently not sure anything
can be done about that.