Revert "Remove some unecessary casts."

VC++ thinks these casts are necessary, even though gcc and clang
disagree.

This reverts commit 8c45343bd3aeb78cb1b77d8e83fc2b2f21022f60.

Change-Id: I9c308561e3c0696c66e24e45fd6fa4384c70aa34
Merge topic 'wrap-const-cast' into master

af541360 Revert "Remove some unecessary casts."