win: fix buffer leak on error in pipe.c