disable major-mode while re-writing file

  This improves both speed and stability, especially when the mode in
  question is a cc-mode.