[Tests] Don't use dirname() - it isn't safe.  Also, use asprintf().
[Tests] Don't use dirname() - it isn't safe.  Also, use asprintf().

Replaced dirname() as the man page says (alarmingly) that it might write to
the input string.  Also use asprintf() to build the new value for
DYLD_LIBRARY_PATH.

atrick/swift,apple/swift,benlangmuir/swift,benlangmuir/swift,benlangmuir/swift,JGiola/swift,gregomni/swift,glessard/swift,hooman/swift,gregomni/swift,apple/swift,atrick/swift,glessard/swift,ahoppen/swift,atrick/swift,JGiola/swift,roambotics/swift,apple/swift,hooman/swift,apple/swift,gregomni/swift,JGiola/swift,atrick/swift,gregomni/swift,glessard/swift,xwu/swift,benlangmuir/swift,ahoppen/swift,ahoppen/swift,hooman/swift,hooman/swift,apple/swift,JGiola/swift,apple/swift,glessard/swift,rudkx/swift,atrick/swift,roambotics/swift,rudkx/swift,xwu/swift,hooman/swift,glessard/swift,gregomni/swift,xwu/swift,roambotics/swift,ahoppen/swift,roambotics/swift,rudkx/swift,rudkx/swift,hooman/swift,glessard/swift,rudkx/swift,roambotics/swift,atrick/swift,xwu/swift,xwu/swift,gregomni/swift,ahoppen/swift,roambotics/swift,xwu/swift,hooman/swift,rudkx/swift,JGiola/swift,ahoppen/swift,benlangmuir/swift,xwu/swift,benlangmuir/swift,JGiola/swift