Added a tox_add_friend auto test.
Fixed crash when connection was killed during the packet callback.