Fix 436, and also fix a threading issue WRT profiles

Turns out that directly calling functions on objects owned by a different thread is A Bad Idea™. It's a minor miracle qTox didn't crash whenever any profile switch occurred.