Added generic signal handling mechanism based on pipes to synchronize signals with the main poll loop.