Fix bug in new code: wrong read in set_state_to_done_and_wait_for_stability()

Also, a sprinkle of "final" on locking-related methods.