safeguard GUI against addPitch() returning 0
 #17906 (Using MIDI input to input chords causes crash): Reworked moveToNextInput() logic in addPitch(). moveToNextInput() is called before actually inserting a new node, except if adding to a chord or if it is the first note inserted. A new flag InputState::moveBeforeAdding has been added just for this purpuse.
Merge pull request #166 from muelleki/17906-chords

#17906: Chord input from MIDI works again