Fix race condition/fix rename labels (#1043)
Fix race condition/fix rename labels (#1043)

* Fix race condition

From filelock.py in UnixFileLock
        # Do not remove the lockfile:^M
        #^M
        #   https://github.com/benediktschmitt/py-filelock/issues/31^M
        #   https://stackoverflow.com/questions/17708885/flock-removing-locked-file-without-race-condition^M

* Encode (){} in label: query

GAM-team/GAM,GAM-team/GAM