Revert "Fix two small memory leaks by eliminating pointless strdup() calls."

This reverts commit 4cb7bfd7ed7eb1113e9d2aeb4adc0d089364bab7.
Fix memory leaks related to get_asf_tmp_dir() and get_asf_share_dir().