Fix of an infinite loop in the snapshot recorder thread.