ktest: don't generate duplicate PDF files. kompile: remove .k

This fixes #789 and #943 .

Since no one commented about #943, I took the liberty to go with the conservative approach. KTest now should not generate same PDF files multiple times, so no race conditions about .k directory is happening. Second commit then removes .k directory after kompile is done.