fix timer in case of EINTR