sanitizeCookieValueImpl nests inside getCookieImpl

This is the only place it is actually used, and the way it was was
causing psc to dead-code remove the helper that we totally need.