How did stalled talks turn into a deal between Israel and Hamas?