Make OtherThreadExecutor implement Closeable to make orderly thread
shutdown easier.

o Callers can now use try-with-resources.
Make NestedTransactionLocksIT more readable.
Ensure that all tests close transactions reliably.

o Recent changes to database shutdown mean that we now wait for transactions
   to finish when shutting down. This mean that each of the many tests which did
   not close their transactions was hanging for 20 seconds before failing.
Merge pull request #1474 from jakewins/merge-unclosed-txns

Fix unclosed transactions in tests, re-enable proper shutdown cycle.