Ultimately this issue was caused by a bad RAM memory configuration, i.e. hardware related. It started rebooting even when not running Notepad2. Memtest86+ was also showing errors on the random test. Though it did seem like running Notepad2 somehow triggered the shutdown/reboot more often than it normally would (when not running Notepad2). But once I re-configured the RAM memory the whole problem went away. The Memtest86+ tests also now completed successfully. I had to under-clock the memory.