pacman/util: flush terminal input before reading response