Transferring file through pthread library and changed code style