Free up allocated memory -- it makes Coverity happier.
Acquire the live system's lock around the save/restore of the first-first
flag -- we don't currently need it (because we only read the flag in one
place), but it's safer going forward if that ever changes.