Revert "Use QHostInfo to get local host name."

QHostInfo is only available in Qt5.

This reverts commit d95aa568864d4a63b29495a1be9b053e82254c0a.
Wait for server to finish after kill signal.