Remove potential race condition from the keyboard ring buffer.