Use LLVM's preferred current_path API instead of calling getcwd(3) directly.

The existing code also failed to allocate a buffer for it so getcwd corrupted
the stack. sys::fs::current_path takes care of the memory management.