Allow registering a signal handler so we can flush on Ctrl+C