Bug Fix: Incorrect IP returned as next available on subnet

If there is an existing DHCP record for a host, the address is re-used even if it's from a different subnet.

This fix introduces a check to ensure that the address which is selected only comes from the existing record if the address also belongs to the given subnet.