Avoid timeout with >= 1 billion nsecs

Registering a timeout of >= 1000 msecs produced an error message,
but still resulted in a system call with timeout nsecs >= 1 billion,
which would cause an error return from the system call and a crash.

Avoid this by restricting timeouts to the maximum. Also enforce
minimum for symmetry.

Bug: 140968481
Test: TreeHugger
Change-Id: I191fb88a03bf09d2c5a93864bb26624c10b6e52d
Merged-In: I191fb88a03bf09d2c5a93864bb26624c10b6e52d
(cherry picked from commit c3632b1aab9fa47a0193b200b61bbc9ff1374fb6)
1 file changed