Merge pull request #4243 from leoetlino/signal-headless MainNoGUI: Shut down cleanly on SIGINT/SIGTERM