Cherry-pick upstream 43a3ca422337551ef4d2fb1331e8b765e0e13d0a

Fix storing avatars, so that they are not stored millions of times each

--

None of the few other patches in telepathy-qt upstream are immediately relevant to us, and I don't want to deal with the build failures and conflicts with the Qt5 patch right now. This one is useful.