Fixed a bug that get_ip in static manager reaches out of index.

A bug is found on last commit.

If static ip pool is not big enough, then get_ip tries to obtain ip out of bound while it should search again from  index 0.