Fix race condition in using an unsynchronized map in ServiceCache