Make it easier to create a detached thread, it's always the same and error-checking is quite repetitive.