Force rescheduling within a callback.

Seems to fix #4914.  We already have a larger bug for callbacks.
Workaround a strange zlib crash in debug mode only.
Merge pull request #5247 from unknownbrackets/callbacks

Work around a callback issue and a strange debug-only crash