Fixed a potential deadlock with TickThread.

These webserver deadlocks will kill us one day, because they're everywhere and they're extremely difficult to work around!