Fix race condition in port allocation

Fix race condition in port allocation by eliminating a goroutine.  @peterbourgon @ohm @elenadeneva92 
You're still using `a` instead of `got`.