Made BufferedConsumer's _flush_endpoint more thread-safe by making sure ...

...only events that are sent are cleared from the buffer. This prevents a race condition in the mixpanel-python-async where events were dropped if queued up while other events were being sent. See https://github.com/jessepollak/mixpanel-python-async/issues/4 for more information.