Avoid compiler-generated memset by using internal_memset.

Fixes PR17025.