Fix time measure issues by system time changes (e.g. NTP update)
Replace all gettimeofday calls with getmonotonictime

Signed-off-by: Stefan Wahren <stefan.wahren@i2se.com>