The line that writes out those icons is in a renderer, so you should be able to override it to some degree.
https://github.com/moodle/moodle/blob/master/course/renderer.php#L806-L808
However, from previous experience I've found that often these things are also defined in other places, e.g. if you drag'n'drop a file into a course it might try to create that same HTML via javascript, which you'll have a much harder time changing.
Another approach I've used in these situations is to use CSS to first hide the existing icons, then use CSS to add the font icon instead. Unfortunately CSS :before, which is a handy technique for doing this, doesn't apply to img tags, which is generally what you're trying to target.
What I've never tried but might be relevant here, is to use
SVG icons as a source. I think you can
download Font Awesome icons individually as SVG and PNG from
http://icomoon.io/app/ so then you'd just have a bit of renaming to do.
I've attached an IcoMoon font icon (from their own set, not Font Awesome, they offer a few different sets to mix'n'match from) exported as a black PNG at 24 pixels.