AsyncHttpServer: fix some bugs around end invocation behavior