Attach signal and uncaughtException handlers only once. Resolves #4