Check CacheService registration before collecting stats

Master branch of https://github.com/hazelcast/hazelcast/pull/3651