replace magic number with macro NUM_LATTICES

We currently always split lattices into four sublattices, and the
number 4 is used throughout the XS code for this reason. Replace this
use of 4 with a macro to indicate that it is the number of sublattices.