Fixed wrong use of libwebsocket_write and a memory leak in the webserver.