Properly undo changes when cancelling out of the options gui using the ESC key