Pakistan beat Afghanistan by one wicket to qualify for Asia Cup final