Fix safe_write_full termination condition.