Detach from controlling terminal to avoid receiving SIGINT.

This fixes #698. It has only been tested on one Linux system.