Identifying ports in use on macOS and Windows