Reuse internal thread ids

Uses a bit vector to remember which ids have been used. The bit vector code was lifted from Dalvik and slightly modified (mostly types). Tested via:

```java
for(int i = 0; i < (1 << 16); i++) {
	final int threadId = i;			
	new Thread(new Runnable() {
		@Override
		public void run() {
			System.out.println("Thread " + threadId);
		}
	}).start();
}
```

Should run the full test suite on it.