A British diplomat has resigned over claims continued arm sales to Israel could be making the UK “complicit in war crimes”.