Fix const-cast-away warning.

(cherry picked from commit 6d087236955f405a526f87f5975c3691c2664176)