using lsof to make sure ports are actually free before returning them