#457744 by quicksketch: Insert missing calls to file_attach_delete() and file_attach_delete_revision().