U.S. and Iraq agree on immunity for American troops