Add synchronization in server.Containers

This fixes races between ps and other operations