app: add gimp_grid_get_spacing() and gimp_grid_get_offset()

and do the rounding to integer there instead of in several places.

(cherry picked from commit 5e2ded502066e7d54a120a0fb03927e41b723453)