I'm not sure this is needed.  Close is supposed to block until the data is in HDFS, not necessarily on disk.