Fix race condition in recreate containers