Multithreaded server written in c