WIP: fix persistent port allocation

This piggybacks on #6555 with some fixups according to @lk4d4's comments. More to come, but please feel free to review at any point.

/cc @crosbymichael 
so @LK4D4 basically said it; we encountered this before the 1.0 release, and this was the ideal fix at the time. I'm not sure we're going to avoid binding errors for ports that aren't allocated (e.g., port 80 or 4243 :) so the retry is necessary.