Fix potential race condition in restoring checkpoints.
Before this cl, gfile.isdir(ckpt_dir) could return False, b/c ckpt_dir did not exist.
And if right after that ckpt_dir was created as directory, gfile.exists(ckpt_path) would return true and we'd try to read ckpt_dir as a checkpoint file, which would fail.
PiperOrigin-RevId: 374874617