Work around a problem with deallog when loading shared libs.

I have no idea how this happens, but the patch at least explains the symptoms...