Fix calculate nearest tvp

the `tvp->tv_usec` was always not less than zero, and if `tvp->sec`
less than zero, `tvp->tv_usec` must be zero.