Fixes

See commit messages.

other issues:
* make_daemon() close stdin/stdout/stderr, it is erroneous. dup2 "/dev/null" is a choice, or better to to files.
* socket_accept() don't handle case that there is no connection, which may happen in rare case, in listen queue (qnet_tcp_accept() return 0(QOK) in this case, in my opinion, it is not a good idea, just because 0 is a valid file descriptor).