Write file using rename
Avoid use of 'file' module in rabbit_file
Re-order
Merge bug25617