image/jpeg: handle those (unusual) grayscale images whose sampling
ratio isn't 1x1.

Fixes issue 4259.

The test data was generated by
cjpeg -quality 50 -sample 2x2 video-005.gray.pgm > video-005.gray.q50.2x2.jpeg
cjpeg -quality 50 -sample 2x2 -progressive video-005.gray.pgm > video-005.gray.q50.2x2.progressive.jpeg

similarly to video-005.gray.q50.* from
http://code.google.com/p/go/source/detail?r=51f26e36ba98
the key difference being the "-sample 2x2".

R=rsc
CC=golang-dev
https://codereview.appspot.com/7069045