Fixed various bugs found during debuggin of sight service:
added network byte ordering of image length transmission and recpection
fixed net_writen and net_readn to continue if they receive EWOULDBLOCK or EAGAIN
  given that the sockets are in non-blocking mode