[simulation] update `alarm` to avoid cast from `uint` to `int` (#7017)
[simulation] update `alarm` to avoid cast from `uint` to `int` (#7017)

This commit updates and simplifies the `alarm` platform implementation
under simulation by adding new functions to determine whether a timer
is expired and calculate the remaining time. The new code does not
use casting a `uint32_t` value to an `int32_t` (since its behavior is
toolchain/compiler dependent and it is not defined by the C++
standard).
jwhui/openthread,srickardti/openthread,abtink/openthread,openthread/openthread,openthread/openthread,jwhui/openthread,jwhui/openthread,jwhui/openthread,abtink/openthread,abtink/openthread,srickardti/openthread,srickardti/openthread,abtink/openthread,openthread/openthread,openthread/openthread,srickardti/openthread