Fix infinite loop when skipping unsafe timed tests.

We need to make sure the timeout is updated also when the test is
skipped, otherwise it will reattempt the timed test over and over.
Empty array before filling it in functions.

Attempt to fix Redmine 6369