Allow for variance in netCDF4 behaviour.

A replacement for #1258.

@bjlittle - would you mind taking a quick look.