Add a simple ring-buffer implementation

This commit adds a very simple ring-buffer implementation which will be
used by `Crash_logger` in a subsequent commit.

Not much functionality is implemented, only what's strictly necessary.
Rework and speed-up `Crash_logger`

During profiling it turned out quite some time (somewhere between 5 and
10%) was spent in `Crash_logger.add_to_crash_log`, which is a fairly
'hot' function.

These changes rework `Crash_logger` so `add_to_crash_log` becomes an
almost-no-op. It turns out after these changes the function is
completely inlined, and turned into an array assignment and an integer
field update!

There's a (minor) change in functionality: it's now possible the crash
logger contains more messages than its upper limit, but the overflow
should be minimal.

Overall, the changes boil down to the following:

- Use a `Ring_buffer` instead of `Lwt_sequence` to store log entries

  This removes the need to validate the number of memorized entries
  inside `add_to_crash_log` and keep a total count. It also removes the
  need to clean up the `Lwt_sequence` in this function. As a result, the
  function becomes really small and can (and seems to) be inlined at
  call sites, so the overhead of `add_to_crash_log` becomes only an
  array assignment and an integer update.

- Don't create single-item lists when unnecessary

  Prior to these changes, messages were logged on-by-one in the
  `Lwt_sequence`, but still passed as a list to `add_to_crash_log`. On
  the other hand, when a list of messages had to be passed, it was
  paired with `None` values as exception payload, which introduced
  unnecessary list traversals and allocations.

  This change adds some more constructors to differentiate between
  single-message payloads as well as lists of messages. This is somewhat
  ad-hoc, but reduces allocation rates.

  The logged entries are simplified a bit as well, not storing the log
  level as a string but keeping the `Lwt_log.level`, turning it into a
  string only when the entry needs to be rendered.
Merge pull request #455 from Incubaid/speedup-crash-logger

Speedup crash logger