Add tox_wait() for socket, allow tox.h include in tox.c

tox.*, Messenger.*, network.*;
- new function tox_wait() => waitMessenger() => networking_wait():
  - waits for a given amount of time for any sort of socket activity
  - mustn't change anything inside, mustn't poll or do other stuff
    - the point is to be able to call this asynchronously from a second thread
    - the outside shall follow up with an immediate tox_do() when there's socket activity

tox.*:
- allow inclusion of tox.h into tox.c, ensuring that the outside interface and the internal always match

util.c:
- squished a few warnings about questionable format strings
Only add write-ready to select() if we have packets queued

Lossless_UDP.*:
- sendqueue_total() sums sendqueue() across all connections

network.*, Messenger.c:
- sendqueue_total() is collected and then used in deciding if we select() on write-readiness
Fixed some possible bugs.
Broken *_wait() into *_wait_prepare() and *_wait_execute()

To allow the actual waiting to run without any locking, split it into preparing the data it uses and the execution of the wait.
The caller must provide with the buffer to store whatever data it requires to wait.
Completely eliminates any reliance on the existence of anything but that data in the actual wait routine.

Also fixed a few argument type warnings inside LOGGING.
m_addfriend_norequest now prevents you from adding your own id as friend.
Fixed file sending bug.
Tox sync added.

Tox sync is a proof of concept bittorrent sync inspired application that
uses tox to sync the contents of two folders.

Currently only works on POSIX compilant operating systems.
Fixed warnings.
sendqueue_length no longer determines if we check for socket-can-write, but sendpacket() sets a timestamp if it happened

network.*:
- sendpacket(): checks result and on EAGAIN, stores time of this event
- networking_wait_prepare(): uses the time if set to check up to 500ms later for the socket to be writeable again
- networking_wait_cleanup(): clears the time if the socket was writeable
- fixed some accidental tabs

Messenger.*, tox.*:
- pass-through functions to reach networking_wait_cleanup()
- fixed some accidental tabs
Merge remote-tracking branch 'upstream/master' into wait: replace void *tox with Tox *tox in tox.c (which now includes the declarations from tox.h)
Oops. Didn't pass along the results from inside to outside...
Code cleanups.
Code cleanups.
Some configuration/build fixes, so building basicaly everything else than the library can be disabled
Merge pull request #613 from BtbN/compile_pure

Some configuration/build fixes
Merge pull request #609 from FullName/wait

Add tox_wait() for socket, allow tox.h include in tox.c
Added function to get the piece size for sending files.
fix for missing EAGAIN definition on windows
Merge pull request #616 from naxuroqa/master

fix for missing EAGAIN definition on windows
Update DHT_bootstrap.c

Removed deprecated compilation instructions