Hide instance from lambda functions

This fixes a possible memory corruption where the list of instances is
resized while another thread is trying to access an instance.
Clear events after passing them to java
Merge pull request #5 from pippijn/master

Fix tox finding cmake script, add test stubs
Load library in Tox4j class static init