add error checking when deleting old apks

the list of files can be null here if for example an io error
happened somewhere.