rename_tmp_log(): limit the number of remote_empty_directories() attempts