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
Merge pull request #469 from fluent/fix-buffer-with-monitor-agent-race-condition

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