Move file transfer in the core thread

Toxcore is not thread safe