[Fixes bug #1181929] Fix bug with the Pencil tool drawing on the left
side of the image when you cross the right border.

The pointer arithmetic in GetColorBgra results in some interesting
behaviour when dealing with pixels outside the canvas.