Reopen STDIN when editing file.

This prevents editors from doing strange things.

Not sure if this code is really portable though.