Eighteen nations including the U.S. and China agreed to sign up to guidelines governing potentially dangerous encounters by military aircraft, a step toward stabilizing flashpoints but one that leaves enough wiggle room to ignore the new standards when a country wants.