fix #30011: crash on delete of staff with cross staff note

Also fixes http://musescore.org/en/node/40006.