The M9 is still a perfectly viable modern handgun, so even assuming the military buys enough M17s to replace every single M9 I would wager that the CMP would still pretty much be the last option.
They're hardly outdated, still use the NATO standard sidearm and SMG round and variants are still produced by the manufacturer for the civilian market and probably other countries, so I would imagine the military's first choice is to stockpile them in warehouses to either use in WW3 or sell off piecemeal to the whatever militia or military of the week that we're sending weapons to. It's a heck of a lot easier to store pistols than tanks, and a heck of a lot cheaper to ship someone a few thousand M9s as "military assistance" than trying to find a way to get them some humvees.
There's also always the national guard to give some to or other military auxiliaries.
And to echo a previous poster, because I have just listed out a few perfectly logical reasons to keep or sell them abroad, they'll probably just crush them all.