app_server/html5: Set initial thread ID. Improve tracing