hash-object: fix buffer reuse with --path in a subdirectory