Two Palestinians were shot dead after going on a deadly killing spree on Tel Aviv's light rail system, killing six and wounding nine others, Israel says.