UIInitHandler emits Content-Length when writing json response (#15271)

This prevents chunked-transfer mode and allows server infrastructure to
decide correctly on things like compression which benefits from knowing
a content length.

Change-Id: I4e969e0874b506d0f61526662ee78418987937c4