Removed unused functions.
Added timeouts to client mutex locking (helps when job crashes in the
middle of a transaction).