Added signals and memory cleanup on SIGINT in server.