Code cleanup...Rename variables to be clearer about what they do, avoid
hungarian notation (namestr -> name).
f->fid was quite confusing (is it the tox-id, id-string or
friendnumber?).
f->num is much clearer. Same applies to all callback-
functions (fid -> frnum).
The separation of Tx and Rx is completed by separating tx-
and rx-state.
Also fixed a strange portion where an active receive-state was
checked by looking at the file-number. use the rxstate for that.