Ensure previous sources refs are updated during track
Description
As shown in #1010 (closed), in an element with multiple sources, if a source required previous sources to track, refs wouldn't be updated during the track stage and this would result in trying to fetch sources in an inconsistent state (despite being tracked).
This MR extends Source._save_ref method to allow refs to update the state without writing to file, and calls this in Source._track to ensure state is consistent in the spawned track job.
This merge request, when approved, will close: #1010 (closed)