Moved declaration of newctx inside the ifdef USE_WEBSOCKET block

Moved the declaration of newctx inside the ifdef USE_WEBSOCKET block to suppress unused variable warning when USE_WEBSOCKET is not defined.