Change JSAPI error logging
Allow clean Thread self destruct