pipe: For wrapped messages, use wrapped headers

07fec4c4d19d27eade440bad0041a952ea4f99f8 introduced the ability to receive and process messages forwarded as a message/rfc822. However, the email headers that were saved on file in the %email_info_table were the headers of the outer message.

This patch pulls the headers from the wrapped message to be saved in the database. This mainly addresses the email References and In-Reply-To headers for the email responses from the system.