Use lsof to detect in-use ports before restarting