socket_test: ensure timed_write returns proper bytes