fix for undoManager isUndoRegistrationEnabled
improved as per aparajita
Merge pull request #1835 from BlairDuncan/undoManagerFix

Fixed: initialize _undoCount to 0 so comparison tests work correctly