Added hook for thread creation, made vm project compatible with CLion

This PR explicitely puts the Java thread object into a local variable so we can easily hook into the detachThread function and get notified when a Java thread exits.

This PR also fixes compatibility issues with CLion, namely that we require to set OS and ARCH via parameters, which is currently not supported by CLion. Also fixed an issue in the libcore CMakeList that CLion's parser couldn't parse.