script: use gettime_monotonic() to get timing file timestamps

This moves the previous time to script control structure, and does
timeval calculation with timersub() that is more appropriate than
making a timeval to a double.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
script: add noreturn function attributes

Signed-off-by: Sami Kerola <kerolasa@iki.fi>