Fix potential deadlock issues when exceptions arise in NIO libs

If the log handler (called when the code attempts to log anything)
that depends on Timber acquires a lock before continuing we might
get a deadlock with the NIO libraries; the locks are normally
acquired by log handler and then the NIO libs used by Timber but
if there are exceptions in the NIO libs we'll get a callback with
the lock in the NIO libraries already acquired. When we are logging
the exception we will get a deadlock if another logging operation
is running since we are acquiring locks in the oppsite order.