Generalize boxLengths to handle non-orthogonal unit cells.