Problem with removeAllListeners(), fixes #1883

- move process.removeAllListeners() to signal handlers