server: Make recv_messages member of Server

Also, remove all pthread usage in server now. We use detach() method from thread after the creation to be able to handle it properly in the end of the thread.