Fix dot2ipv4()

Correctly consider strings with fewer or more than the expected number of
numeric fields, or any field outside the range [0, 255], to be invalid.