Fix panic on restarting containers with no name.

Fixes #2545