Revert attempts to remove pointer subtraction from libz

This reverts commits:
28fb177f64c8c1213b58a41015d52d5f1f6699c8
420e060824f778112e9ece4fb63fbae35f0ea530
85ff216c231fd8ec78206f67ca0d145bc7f8b63f
98dcbe6ada7dff96234631bc627aa7abe625f247
8cc52ec9aac557d181f86c7ad1ee0b12277f5207