Moving hazelcast instance initialization waiting logic to a thread