pipe: Fix missing mask update after pipe_wait()