It seems that the extension handshake response is sent before the extension handshake request. The flow described here says send the request first and then receive the response. So, in my opinion, the tester code should wait for the extension handshake request before the response. You can clearly see void doExtendedHandshake(const TCPHandler &tcp_handler) that in Commands.cc (of my submission).
Also, the length field in the extension handshake message seems not to be in network order. Please see std::string Message::serialize(bool convert_length_order) in PieceMessages.cc (of my submission).