Fix a leak with DtlsFactory; a new instance is being created for every single DtlsClient/Server creation, but the factory was never being destroyed.

Also some various cleanup--remove unnecessary setSocket call (was already being done through setDtlsSocket), make some code a bit more readable, etc.
Remove unnecessary null checks before delete/free statements.
Remove strtok, it's not reentrant and should not be used in threaded programs.
Merge branch 'jnoring-master'