Tcp: introduce WriteFile to support zero-copy writing of files, fixes #2896

This is the rebased version of PR #1061.

In relation to the previous PR following has changed:
  * rebased to master
  * test case now doesn't create test file any more but tries to take existing jar file from the classpath
  * we are still using one dedicated file IO thread for scheduling all file IO operations