add a lock in _update_location_cache

This makes sure self._location_cache is not checked while it is updated (i.e. while it is not None, but also not completely populated).