A prominent Jordanian writer was shot dead on the steps of a court where he was facing charges for sharing an anti-Islam cartoon on Facebook.