This is used by the Hydra queue runner, but since it may also be useful for the C++ rewrite of nix-push, I'm putting it here.
Otherwise we might leak memory.
`BUFSIZ` is defined in header `<cstdio>`.