fix tvp == NULL

If dwMilliseconds is INFINITE, the function will never time out. so... when tvp is null,we must fix it.