Cleanup temp files after conversion

Also added more tests and stricter checks for temp file
naming collisions, rather than relying on SplFileObject