Ensure that background threads are run as daemons, not to block shutdown