Fix bug in adapter.update

This PR fixes a bug in ``BaseAdapter.update`` that prevented updated rates being saved to the db because the id was not set on the ``ExchangeRate`` object.

Also included is a fix/optimisation to the caching mechanism that writes to the cache after a cache miss.