Fix #23538: update accidentals when tie is deleted

UPDATED: This is to fix #23538 (formerly #12116):

Added call to updateAccidentals() in Chord::remove(Element*) and Note::remove(Element*) to make sure, notes which are no longer tied back get needed accidentals. This was the described issue #23538.

Let RemoveElement::undo() reset the tieBack property of the tie's endNote when restoring a removed tie, to avoid crashes.

Added a call to updateAccidentals() for the end measure of a tie being removed in RemoveElement::redo():
Example: Key signature of F major, a B nat is tied to the next measure which contains a second B nat.
This second B nat needs an accidental because the tied note doesn't have one. If the tie is removed, the first note gets a natural and now the second one does no longer need one. Therefore we need to check the measure of the last note of the tie.

I'm not exactly sure if this is the most efficent way to do all of this, that's why I'm setting this to 'needs review'.