Swap the order in which attachments are made inactive.

The code for marking file attachments as inactive would first remove
from the list of active attachments and then add to the list of
inactive attachments. If anything went wrong in-between, the attachment
could go missing.

It might still be bad for an attachment to be in both locations, but at
least now it shouldn't out-right disappear and break things (in the same
way).

Reviewed at https://reviews.reviewboard.org/r/6564/