src: perform minor cleanups on zlib code
- Use
final
to indicate the classes that we actually instantiate - Properly use
const
(and the necessary associatedconst_cast
for zlib because we don’t defineZLIB_CONST
and allow shared builds) - Store the JS callback in an internal field rather than a
Global
(which improves memory leak debugging capabilities, removes a potential future memory leak footgun, and aligns the code with the rest of the codebase more closely) - Other minor C++ cleanup