Controversy swirls around TV production, screened amid warming Jerusalem-Riyadh ties; head writer says he wants to send message that societies used to be much more tolerant