Fixes http, memory leaks (session was not closed after client disconnect) and hardcoded Http2 version in upgrade handshake