HDFS-2029. In TestWriteRead, check visible length immediately after openning the file and fix code style. Contributed by John George