MAJOR Use os.rename to check that file is busy

Changes:
 -- use os.rename instead of file.open in order to check that file
is not busy;
 -- use tempfile module to create temporary name for renamed file.