Set mimetype from attachment_filename in send_file

In send_file you can explicitly set the filename using attachment_filename,
but when attempting to guess the mimetype previously the code would
check prefer the real filename, this reverses that preference.