src: Apply time limit to whole test.

Including compilation. Applying it just inside QuickCheck makes it
unreliable.
src: Use bracket to properly drop temporary files.

So that it works even with exceptions (such as timeout).