How can I avoid  the "The file x.jpg is in use and cannot be deleted." warning I get when I try to delete a media file?
To be honest this is the behaviour that should be expected of the field/revision system.

If you have an image file that is attached to a node revision, Drupal (rightly) makes sure that another process in the system cannot delete it. If this wasn't done you'd end up with incomplete/erroneous node revisions.

The only options you've got (in terms of the UI anyway) are either deleting the revisions (which you already know about), or removing the reference to the file from the revision(s) in question.

If you're feeling brave you could dive straight into these tables and make the changes manually:


node
node_revision
field_data_field_FIELDNAME
field_revision_field_FIELDNAME


But I strongly advise you only go down that route if you really, really know what you're doing, and have a good backup system in place :)