Fix thread creation

Signed-off-by: Joe Stringer <joestringernz@gmail.com>