Clear undo stack after reloading with new encoding

Being able to undo the encoding change can lead to file
corruption if the re-encoding is reverted and then saved
using the new encoding.