Fixed the using of random port in unit tests.
Merge pull request #323 from lfei815/rnd-port-unit-tests

Fixed the using of random port in unit tests.