The library worked with the assumption that whenever the recv call for
the websocket would lead to a closure, the close method would be called
to signal closure and as a result our close method would be called.
This assumption turned out to be false as the websockets library would
instead call an internal function named close_connection instead. So to
solve our problem we need to override this function instead of close.