web: Factor out the DBusClient and DockerClient object caches.

We will use pattern also for the upcoming NetworkManager code.