use right error exit codes in server.

while at it, clean up all exit error codes to use EXIT_SUCCESS and
EXIT_ERROR.
server: use defines for magic numbers.