For consistency, changed access of thread id to be through capability instead of directly from StgRegTable.