Backport Fix for EDAlias and failing edm::Refs

Nicola Pozzobon reported a problem with edm::Refs which was ultimately traced back to a bug in the handling of EDAlias. See https://hypernews.cern.ch/HyperNews/CMS/get/edmFramework/3159/1/1/1/1/1/1/1.html. This fix was successfully integrated into CMSSW_7_0_X but needs to be backported to CMSSW_6_2_X_SLHC since that is where the problem was originally discovered.