Fix autohold slide-off method

remove some tab char left in previous commit
Fix pthread_key_create failing...

...with "PTHREAD_KEYS_MAX has been exceeded" error.

Also improve "AttachCurrentThread" management.