Fix NCF-244 bug for case where using different order for defining
coordinate variables and their associated dimensions occurs in any
subgroup, rather than just the root group.  If this occurs, the
variable attribute "_Netcdf4Dimid" is created for every dimension
scale.

Also add a test for this bug fix in tst_dims3.nc, based on Pedro
Vicente's demo.




git-svn-id: https://sub.unidata.ucar.edu/netcdf/trunk@3092 2e3060e4-1ed8-cf1f-9cc2-9586e844a556