Toyota has settled a sexual harassment lawsuit against its former top US executive.