Builder for stack middlewares based on HttpKernelInterface.