Implement ENABLE_PROGRAM_MODE for xboot.  Require that the programmer is in PROGRAM mode before any modifications are attempted.  Otherwise exit the bootloader.  This reduces the likelyhood of accidental damage if the bootloader is entered and random data is in the serial buffer.