widgets/email_imap: reorder arguments
widgets: wait on pthread cond before freeing memory

The widget threads will now block on a pthread mutex + cond until
web_view_callback() has used the data. This resolves a race condition
issue where the widget would free data before the callback had used it.