Make BasicBuffer#total_queued_chunk_size thread-safe to avoid Hash related RuntimeError

Report from this thread: https://groups.google.com/forum/#!topic/fluentd/NC9Zo2bM46Q