Pakistan needs to remedy flaws in its democracy to prevent regress to personalistic or military authoritarianism