validate return values from strtol, strtoul (fixes #2564)