fix PhEDEx uploader closing block

fixes #4926