Astyle and fixes.
Fixed some warnings.
Added warnings to travis building.
Fixed segfault when logging was enabled.

m->chats[c] can be NULL if more than one group chat is created and
one of the first ones is deleted.
Added ability to set custom lossless packets in Messenger.
pthread is now a core dependency instead of just a toxav dependency.

Fixed possible thread bug with sending A/V packets.

TODO: eventually make toxcore thread safe.
Updated TODO.
Attempt fix of tox_sync not building on some systems.
join_groupchat now fails when not direct connected.
Fixed typo.

This typo doesn't seem to cause any issue because according to the
code in vanilla NaCl the first crypto_box_ZEROBYTES (for encryption)
and crypto_box_BOXZEROBYTES (for decryption) of the array passed to
the crypto_box*() functions don't need to be zero for it to work.

The documentation however clearly states that they need to be zero
which means they need to be zero.
Const correctness for toxcore/assoc.c
Const correctness in toxcore/onion_client.c
Const correctness in toxcore/friend_requests.c
Const correctness in toxcore/group_chats.c
Const correctness for various packet callbacks