Double validation: first, don't let underflow through.  Second, save errno and restore on success.  Third, properly trim() string to prevent ending whitespace from invalidation.  Remove superfluous check for empty string and re-add it for the trimmed version.  Most of this in a suggestion by schwarze@, thanks!  (Also add a small one-liner for easier reading of udouble, also by schwarze@.)
Double validation: first, don't let underflow through.  Second, save errno
and restore on success.  Third, properly trim() string to prevent ending
whitespace from invalidation.  Remove superfluous check for empty string and
re-add it for the trimmed version.  Most of this in a suggestion by schwarze@,
thanks!  (Also add a small one-liner for easier reading of udouble, also by
schwarze@.)

kristapsdz/kcgi,kristapsdz/kcgi