web: Factor out the DBusClient and DockerClient object caches.

We will use pattern also for the upcoming NetworkManager code.
Shouldn't we make this part of the ```cockpit.``` namespace while refactoring?