Replace assert(false) with writefln to avoid memory allocation in finalizer.