backported background threads fix for Process.daemon