The ouster of Prime Minister Nawaz Sharif heightens instability in a nuclear-armed country plagued by terrorism.