make collision callbacks work as entity methods

* fixes a problem with global collision callbacks/signals (this has been broken for a while apparently)
* added support for collisionWithEntity() and collisionWithVoxel() methods on entity scripts
* changed the read write lock in the octree to be recursive so collision scripts can edit the entities
* changed EntityCollisionSystem::updateCollisions() to use a write lock instead of a read lock since it can modify the tree.
* fixes a thread deadlock on enter/leave entity events.