Cache MediaServicesEndpoint using azureMediaServicesEndpoint parameter of AzureMediaServicesClassFactory constructor as the key.
Check cache for null before disposing.