Improvements to init time for large services with couchdb caches.

1) Only initialise the DB when a connection is required, not once for every cache at service initialisation.

2) Lock to prevent initialising more connections than required (e.g. when multi simultaneous connections are received).
Update couchdb.py

Modifying locking as suggested.
Merge pull request #100 from keithamoss/couchdb-init

Improvements to initialisation time for large services with couchdb caches