[PATCH 3/5] shcore: Add ThreadRef functions.