The former boss of Australia’s peak spy agency has resigned from his special role at the Royal Commission into antisemitism.