Precalculate pbc shift for analysis nbsearch

Instead of using pbc_dx_aiuc(), precalculate the PBC shift between grid
cells outside the inner loop when doing grid searching for analysis
neighborhood searching.  In addition to improving the performance, this
encapsulates another piece of code that needs to be changed to implement
more generic grids.

Change-Id: Ifbbe54596f820b01572fe7bb97a5354556a4981d