util-core: fix infinite loop in NetUtil

We have discovered an infinite loop in NetUtil.isInetAddressInBlock. We changed its implementation to use NetUtil.isIpInBlock and added a test.