Added functions tox_count_chatlist and tox_copy_chatlist.

These functions are akin to the tox_count_friendlist and tox_copy_friendlist, made available on the public API.
Fixed a few typos.
Added null check to each chat before incrementing.
Fixed a cuple stylistic bugs. Behaviour should be the same but the code is now proper. Also fixed tox_copy_friendlist.
Merge pull request #656 from Jman012/master

Added functions tox_count_chatlist and tox_copy_chatlist.