Request For Enhancement: Scopes.getCachingProvider(Binding)

The recent change to support finer-grained singleton locks removed the ability to take a prototype binding from the injector and turn it into a lazy caching provider, using the same lock as if it had originally been bound as a singleton. It's important that the same lock is used, otherwise there is potential for deadlock when mixing these caching providers with singletons already bound in the injector inside the same app.

This RFE introduces a new method Scopes.getCachingProvider(Binding) which takes a binding and returns a lazy caching provider backed by the binding. If the binding is associated with an injector then it
will use the injector's singletonCreationLock. If the binding is for some reason not associated with an injector then it will use the binding itself to synchronize caching of the provided value.