Lazily fill CharTermAttribute if needed in CompletionTokenStream

This adds a delegate to CharTermAttributeImpl to be compatible
with the Percolator that needs a CharTermAttribute. Yet compared
to CharTermAttributImpl we only fill the BytesRef with UTF-8 since
we already have it and only if we need to convert to UTF-16 we do it.

Closes #4028
Added docs for River start and close methods

Closes #3787
Add river creation test
Schedule retry if the river type is available but the _meta document isn't

With #3782 we changed the execution order of dynamic mapping updates and index operations. We now first send the mapping update to the master node, and then we index the document. This makes sense but caused issues with rivers as they are started due to the cluster changed event that is triggered on the master node right after the mapping update has been applied, but in order for the river to be started its _meta document needs to be available, which is not the case anymore as the index operation most likely hasn't happened yet. As a result in most of the cases rivers don't get started.
What we want to do is retry a few times if the _meta document wasn't found, so that the river gets started anyway.

Closes #4089, #3840
Added heap_max(_in_bytes) and heap_used_percent to JVM node stats.

 Closes #4145
fixed a broken trace logging line.
Initial implementation of Snapshot/Restore API

Closes #3826