Fix spawn of compress_cmd hang

Spawn of compress_cmd hangs if pipe_wr is not closed before spawning.