Validates if a value is an integer.