HDFS-7373. Clean up temporary files after fsimage transfer failures. Contributed by Kihwal Lee
(cherry picked from commit c0d666c74e9ea76564a2458c6c0a78ae7afa9fea)