Nobody wants contaminants in the anhydrous ammonia (R 717) used for refrigeration. However, I can testify having seen industrial refrigeration plants using for years long commercial or agricultural grades of ammonia with about 2500 ppm water content without suffering any process predicament as a result. Refrigeration grades contain a maximum of 150-200 ppm water.
The aqua-ammonia formed in the chillers gets to the lowest (coldest) points and must be drained off, signifying in a loss of refrigerant. The vaporized ammonia contains much less moisture than the flashed liquid.
This draining operation also allows for some of the entrained compressor-oil to be removed not to impair heat transfer. This being another source of ammonia losses.
Even when working at pressures above atmospheric (see BenThayer's post above) there are cases when air may enter the system as when dissolved in the lube oil used in oil-flooded screw compressors with recurrent replenishments.
There are automatic and manually-operated vents in the market, that function by chilling the vented gas. These are usually located at the condensers' high points. Air, as well as other non-condensables, do not only impair heat transfer in the condensers but oxygen, for example, is also blamed for the appearance of SCC in storage tanks containing anhydrous (less than 0.2% w/w water) ammonia (see nbucska above).
As for the determination of water content, I've been told moisture is usually measured on vaporized ammonia samples.