Python port of CoalescingRingBuffer from LMAXCollections