PopulatePatchesByPackage: Refactor code common with PopulatePackages

Remove duplicate code in PopulatePatchesByPackages.py, move
common logic in populate function of PopulatePackages.py into
populatePackageMapByCSV and share with both.

Change-Id: I58e45cf5c00638e3d7259d9fe65654cb078e3cbe