Fixes #332 by spawning a thread when signals are trapped