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.
Merge pull request #1363 from chrisvest/fix-flaky-kernel-panic-test

Make BufferingLogger Thread-Safe