Close pipe after running commands in Emacs notifier

Fix #487.