Media recovery binmode

- Set the tempfile creation to binary mode
- Support automatic media recovery if the file doesn't exist in the media buffer area
- Check stub in filter-clean to avoid modifying files which haven't been synced