tests/kernel/thread_apis: Fix timing order

This test understood that it can't demand equality in timing because
of races against real time, so it simply validated that the test
started at or later than the expected timeout expiration.

But when calculating the expected time, it called k_uptime_ticks()
AFTER the timeout was registered.  So on systems with fast ticks (or
just bad luck) a tick expiring between the two steps will look like an
"early" expiration and fail the test.  Do things in the proper order.

Also, use the correct APIs for unit conversion and timeout
construction.

Signed-off-by: Andy Ross <andrew.j.ross@intel.com>
1 file changed