datapaths: Fix port generation regression

55a130166 made a number of improvements to port generation for the software
switch, but also totally broke it.  With any luck, this fixes things.

Thanks to Guangvy for the bug report.