Prevent deadlock in the processor (#802)
Prevent deadlock in the processor (#802)

Prevent deadlock in the processor which results when a bulk line item cannot be serialized.

See issue #76 for more details.  This commit ensures that the Source()
of a bulk index request can be constructed successfully before it is
added to the bulk service.

When the bulk processor adds a request that cannot be serialized it can
enter an infinite loop where it repeatedly tries to flush the request but cannot.
This can happen when any source document contains JSON marshalling errors (e.g. +/-
Infinity or invalid time.Time values).  This problem becomes especially evident
when the bulk process is configured to flush asynchronously.
olivere/elastic,guilherme-santos/elastic,olivere/elastic,guilherme-santos/elastic