Fixed bug between edm::Refs and EDAlias

Nulling out the BranchID for a kept EDAlias some times caused edm::Ref’s created in subsequent jobs which refer to the aliased branch to fail. The failure depends on the exact ordering (branch name and/or branch ID) between the original branch and the alias.

This request also has related maintenance changes and additional unit tests.