Override the global doassert() function temporarily.

Does so within the context of the actual assert call in a
try/finally block.