add watchdog logic

added watchdog logic, but disabled since the MEGA 2560 does not
properly reset after watchdog timeout — seems to be related to the
bootloader