Jordan has largely averted violent protests that have seen Arab leaders toppled in Egypt, Tunisia, Libya and Yemen.