Fix crash when copying MIDI regions with midi-copy-is-fork is on (#6002).