With a growing wave of discontent in the Middle East, from Tunisia to Egypt, Jordan’s king fired his government and named a new prime minister on Tuesday, an attempt to get ahead of protests in his country that began with thousands marching last week.