Cross-platform clean shutdown support with —shutdown-ipc FD flag
On Windows there is no standard reliable mechanism to politely ask a process to stop. There is only the brutal TerminateProcess. Using that by default is not great since it means the node always has to revalidate its chain DB on startup.
This adds an ad-hoc mechainsim that Daedalus can use to reliably shut down the node process. The —shutdown-ipc flag takes the FD of the read ebd of an inherited pipe. If provided, the node will monitor that pipe when when the write end of the pipe is closed then the node will initiate a clean shutdown. So Daedalus can explicitly terminate the node by closing the write end of the pipe. If Daedalus terminates uncleanly then the pipe will also be closed and the node will also shut down.
Although this mechanism is needed for Windows, it is also cross-platform so it can be used by Daedalus across all platforms.