connection: better container_of impl

Works with MSVC 8