global: fix hang when segv happens inside logging code