fix timeout behavior in corner case

the attribute timeout is using the predicate "has_timeout" to verify the value of the attribute (and set the correct values in setsockopt) but has_attr is valid for attributes without default value to verify if there is some value (and undef can be a valid value).

for example, I add two tests. if I set undef, the has_timeout return true and I try to use the undefined value to coerce as an integer. to fix this is simple: I'm just using the value in the boolean operation.

the same for 0 (no timeout). there is no reason to use setsockopt in this case.