GRADLE-2889 Avoided dependency leaks for detached configurations.

configuration.getPath() does not return unique value for detached configurations (e.g. in 2 different projects, there may be a detached configuration named 'detachedConfiguration1'). This might be something worth fixing on its own. For now, I've made the dependency results caching based on opaque id which are configuration instances. This fixes the problem.