Made it so timing.log is opened each time I want to write something in it

Since this is called only when --debug is provided to kompile, it shouldn't be a time penalty for normal usages.

@dwightguth please review.