Timetest: Clean up

Clean up the code a little.

The removed TEMP_FAILURE_RETRY is actually wrong. The others are either
superfluous or needed.

Be more direct with error returns.

For EBUSY, loop at most ten times, with sleep.

Use unique_fd for descriptor tracking/close.

(cherry picked from commit e4944b10a24c39d9aaba7e1093d91438ddf90d09)

Bug: 76008092
Test: atest time-unit-tests
Merged-In: Id7176e0237a416a4bb19d72c47b8e1a2f6b57ca5
Change-Id: Id7176e0237a416a4bb19d72c47b8e1a2f6b57ca5
3 files changed