Fixed unit-tests when $TEMP is a symlink

Reported by Anders F Björklund.