Reset piecesByLayer at the start of each track.

This was a hangover from when the track was created from scratch each time. Now we're re-using it, which means that this has to be cleared otherwise it ultimately leads to an OOB exception.