Tell OpenOCD to pick an unused port, and use lsof to figure out which one it picked.