Keep track of files that are currently being used (file being printed, source and destination for slicing) so that they can't be deleted

Also added logging to exception branches where the exception was formerly just swallowed.