Implement thread safety

In order to guarantee thread safety, this implements a locking mechanisms on all native calls. Locks are associated with public keys in a global map. For ease of use, a reference to the
associated lock is also saved with each instance of JTox. If a new JTox instance is created from an old pointer, the lock is grabbed from the map and added to the JTox instance. This
ensures that there are not 2 different locks in use for the same instance, as this might lead to race conditions. If one tries to call a method on an instance that has been killed, an
exception will be thrown. If the instance undergoes deletion while waiting for a lock (tox_kill acquires lock, some callback waits for another lock), the exception will als be thrown.