fix lazy-open race condition