[api] use random ports for test to avoid port conflict
[api] use random ports for test to avoid port conflict

Closes: #9595

aptos-labs/aptos-core,aptos-labs/aptos-core,libra/libra,aptos-labs/aptos-core,libra/libra,aptos-labs/aptos-core,libra/libra,libra/libra,aptos-labs/aptos-core,libra/libra,aptos-labs/aptos-core,aptos-labs/aptos-core