update checkwrite for issue #4074

the TypeError or NameError happen when the pfn return is empty. So line 28 is added to prevent this from happening 
see : https://github.com/dmwm/CRABClient/commit/31bacc3