Restore writing of chains to affineEnsemble::writeToHDF5Handle

Somehow this got removed in a previous change.
Merge branch 'base'