Multithreaded server written in C