Use realpath for tmp directory if it does exist.