prevent infinite recursion in on_assert_failed

While playing with kakoune I found that `kak -h` segfaults. It turns out to be because:

- the `-h` causes an `assert` to fail
- `on_assert_failed` tries to write to a debug buffer
- it's not possible to create a debug buffer because kakoune isn't initialised yet, so another `assert` fails
- `on_assert_failed` gets called again
- `kak` goes into an infinite recursion and runs out of stack space.

Here's a fix.