Fix working_directory() space handling

I'm not entirely sure what causes this, but it looks like `printf`
breaks the resulting string into segments and only returns the first.