fixed sock_fd_write/sock_fd_read in testmemwrite

Change-Id: I02a3feafe072d79c1ea3529103538802b25abe79