Factor out the IPC server mainloop into a per-platform structure.