Only perturb padded tick marks for rectilinear axes

The function _get_pixel_distance_along_axis does not work for geographic
axes, in which pixels that are outside of the map area cannot be
meaningfully transformed back to data coordinates. To be safe, let us
just return 0.0 unless we are on rectilinear axes.

Fixes #2299.
Add unit test for horizontal gridlines on Mollweide axes

See #2299.