Fixes #4269 by deep cloning the MsbuildTemplateProject for each P2P reference. Add test which migrates and builds P2P references.