Refine code and fix an issue of closing readers/writers.
Merge branch 'hbase-11339' of https://github.com/JingchengDu/hbase into hbase-11339