zlib: replace C cast with static_cast

Seems to have escaped the Eye of Sauron^WFedor in commit 8e29ce9.