Reduce coupling of pm-download / pm-updatecode and package-handler engines. Fix #1022.