Make BufferingLogger Thread-Safe

 * BufferingLogger wasn't thread-safe and caused TestKernelPanic to be flaky,
   as it could occasionally throw ConcurrentModificationException from the
   underlying ArrayList.
 * Also fixed a data-race bug in TestKernelPanic, where registerization of the
   Panic.panic field could prevent us from observing correct behaviour.