Perform proper cleanup on termination of Haskell daemons