Prevent context from being garbage collected before its sockets.