HDFS-7017. Implement OutputStream for libhdfs3. Contributed by Zhanwei Wang.