Add missing va_end

Found by coverity
Add missing va_end

Found by coverity
Fix unmatched if statements

The actual nested level doesn't go with the intention.

Found by coverity
Fix regressions
Fix regressions

"even? 0:0:0" will cause an error
Check return value from fcntl

Complained by coverity
Add asserts to prevent coverity from complaining
Remove dead code

Complained by coverity
Check pointer before dereferencing it

complained by coverity
Fix indentation

This is confusing, and coverity complains about it.
Fix a potential integer overflow

multiplication of two 32-bit integers will yield a 32-bit integer, and
that could overflow, even though it's gonna be stored in a 64-bit
integer. The overflow happens before widening.
Fix integer overflow

This fix the problem:
>> make time! [596524000 0 0]
== 764:26:40
>> to integer! 764:26:40
== 2752000

Found by coverity
Merge branch 'atronix' into coverity_scan