pipe_rdwr_fasync: fix the error handling to prevent the leak/crash