fix bugs introduced when maxtouch was made dynamic
when maxtouch was made dynamic, some optimizations were also
added to the neighborlist build which could result in empty
neighborlists and limited the number of neighbors in those lists.
This collided with some of the heuristics used when threading
the shear history fix. these are now handled. No more segfaults
and multi-threaded trajectories diverge only slowly from the regular.