Move portDB attrs to loop() local vars.

IMO it's fine to have a `func (d *portsDB) isAllocated(port int) bool` (and a corresponding `allocatedc` request chan) used exclusively in testing.