Adds filename debug to locking IO exception handling