[FIX] mail: set the parent_id to the first message of type email

And fallback of any type if there is none of type email

This fix allow the communication between two mail thread from two different Odoo servers having message creation subtypes, like project issue or crm lead