Clean up code and use m_tempfile instead of mutt_mktemp