fix, PEBKAC, after redirecting stdout make sure outfd won't leak

Signed-off-by: Sebastian Freundt <hroptatyr@fresse.org>
fix, PEBKAC, actually move beginning of last line to the buffer front, then continue ...
reading with buffer size being the remainder.

Signed-off-by: Sebastian Freundt <hroptatyr@fresse.org>
fix, PEBKAC, when finalising buffers with \nuls make sure they're actually inside the buffer

Signed-off-by: Sebastian Freundt <hroptatyr@fresse.org>
Merge branch 'code/hygiene'

* code/hygiene:
  fix, PEBKAC, when finalising buffers with \nuls make sure they're actually inside the buffer
  fix, PEBKAC, actually move beginning of last line to the buffer front, then continue ... reading with buffer size being the remainder.
  fix, PEBKAC, after redirecting stdout make sure outfd won't leak