Better support for partial buffer reads/writes in translog infrastructure

Some IO api can return after writing & reading only a part of the requested data. On these rare occasions, we should call the methods again to read/write the rest of the data. This has cause rare translog corruption while writing huge documents on Windows.

Noteful parts of the commit:
- A new Channels class with utility methods for reading and writing to channels
- Writing or reading to channels is added to the forbidden API list
- Added locking to SimpleFsTranslogFile
- Removed FileChannelInputStream which was not used

Closes #6441 , #6576
JAVA API: Fix source excludes setting if no includes were provided

Due to a bogus if-check in SearchSourceBuilder.fetchSource(String include, String exclude)
the excludes only got set when the includes were not null. Fixed this and added some
basic tests.

Closes #6632
Bulk API: Fix return of wrong request type on failed updates

In case an update request failed (for example when updating with a
wrongly formatted date), the returned index operation type was index
instead of update.

Closes #6630
Refactoring: Replaced string values with static constants

in TransportShardBulkAction after fixing an issue.
Fix github download link when using specific version

(cherry picked from commit 388fddb)
[Query] QueryParser can return null from a query

This causes a NPE since XContentStructure checks if the query is null
and takes this as the condition to parse from the byte source which is
actually null in that case.

Closes #6722
[TEST] Order of the results is not important in this test
The query string cache can't return the same instance, since Query is mutable changing the query else where in the execution path changes the instance in the cache too.

Instead the query parser cache should return a cloned instances.

Closes #2542
Closes #6733
Added licence header
Merge branch '1.2' of https://github.com/elasticsearch/elasticsearch into issue6441