[FLUME-2488] ElasticSearchRestClient: Generate Gson API directly.

This avoids using a HashMap before serializing to JSON, since HashMap's
iteration order is undefined and it makes harder to test (Oracle JDK 8
has different iteration order for HashMap with respect to Oracle JDK 7).

This should be faster than the previous method, but it has not been
benchmarked.