Fix race condition in recreate containers

Container might have stopped between checking `is_running` and
calling `stop()`, which then threw an exception.