threaded: "write" returns byte count

fixes #372
1 file changed