Fix mimetype guessing when the file is not readable