Update Elasticsearch Output Plugin to retry bulk

Some actions may fail within the ES client bulk call.
Now, some messages (specifically errors 429 and 503s) will be
retried up to 3 times. If there are still actions that are
unsuccessfully indexed, Stud Buffer will continue its current
behavior (to retry indefinitely).

Stud Buffer will replay all events it first attempted to flush
to Elasticsearch. This means duplicate events may find themselves
in Elasticsearch.

(migrated from https://github.com/elasticsearch/logstash/pull/1997 with a few modifications to make 
tests run once plugin is installed)
I am not sure this is the best strategy here, because it will block at the `@retry_queue_needs_flushing.wait(@retry_flush_mutex)` which could be arbitrary depending on the timeout option and we want to avoid situation were the shutdown is waiting for timeouts etc. I think what we want is: first we are shutting down so we can kill the timer thread then we can refactor `retry_flush` to force a flush, we just have to make sure we are not doing it concurrently with another thread that could call `retry_flush` which should be taken care by the mutex.

now the thing is, what do we do with potential retry errors, do we want to have something in place that will wait until everything has been flushed or discarded by the max retry? or maybe for now we just discard any pending retry and eventually when we have the dead letter queue in place we can push them in the DLQ?

thoughts?