Various audio_attachments fixes

The meat of this is to detect the MIME type of the attachment if it's application/octet-stream. This was done because our (proprietary) voicemail system sends messages in that way.

But there are some other fixes here too.