Tweak getRgbBuffer implementation in CalGrayCS to fix issue 3903

Fixes #3903.