Made distance restraints work with threads and DD
The NMR distance restraints use several buffers for summing distances
that were indexed based on the index of the thread+domain local ilist
force atoms. This gives incorrect results with OpenMP and/or domain
decomposition. Using the type index for the restraint and a domain-
local, but not thread-local index for the pair resolves these issues.
The are now only two limitations left:
* Time-averaged restraint don't work with DD.
* Multiple copies of molecules in the same system without ensemble
averaging does not work with DD.
Fixes #1117.
Fixes #1989.
Fixes #2029.
Change-Id: Ic51230aa19a4640caca29a7d7ff471e30a3d9f09