Error Could not find valid session key wordpress
I'm no WordPress expert, but my reading of the codex is that wp_update_user() will remove cookies for the logged-in user. The docs say it "Uses: wp_clear_auth_cookie()".  

I would try to do the same with wp_insert_user() instead, it says in the codex that this can update OR create new users.