Fix potential UB when target_file directory is null
Summary: As seen in a crash report, the C-string returned for the directory component of target_file can null. It should not be assigned to std::string directly as this is undefined behavior.
Reviewed By: jingham
Subscribers: jdoerfert, lldb-commits, #lldb
Differential Revision: https://reviews.llvm.org/D57964