Fix bug #1333098. Concurrent access to the objectCache needs to be protected.

We add a Mutex around the objectCache map.

While there, I discovered a difference race condition in the api Watcher code.
So I fixed that in passing.

The new test fails if you run under '-race', and the tests in cmd/jujud/*TestMachineAgentRsyslog* used
to fail with the race detector and now pass.
So that is when it finishes, but I was caring that it 'started' vs finished.
'go test -race' is the one that noticed the Add() could happen after the check for Done(), so I'm not sure if it will handle looking at 'in' instead.