c8d/builder: Store parent in c8d image label 

**- What I did**
Fixed `docker images` showing intermediate layers by default (they should be visible only with `--all`)

**- How I did it**
Store information about parent image as a containerd image object label and use that when listing.

**- How to verify it**
```diff
$ DOCKER_BUILDKIT=0 docker build -t asdf .
Sending build context to Docker daemon  2.048kB
Step 1/4 : FROM busybox
3fbc63216742: Download complete
1fa89c01cd04: Download complete
fc9db2894f4e: Download complete
8a0af25e8c2e: Download complete
 ---> 3fbc63216742
Step 2/4 : LABEL asdf=1
 ---> Running in 8815b66a12a4
 ---> Removed intermediate container 8815b66a12a4
 ---> a2b5f145d9d2
Step 3/4 : RUN env>/env
 ---> Running in 2f71fc879fda
 ---> Removed intermediate container 2f71fc879fda
 ---> 53ef1dea7427
Step 4/4 : CMD ["echo", "hi"]
 ---> Running in 26fb9dab31b2
 ---> Removed intermediate container 26fb9dab31b2
 ---> 59da756a8eb8
Successfully built 59da756a8eb8
Successfully tagged asdf:latest
$ docker images --all
REPOSITORY   TAG       IMAGE ID       CREATED         SIZE
asdf         latest    59da756a8eb8   4 seconds ago   6.11MB
<none>       <none>    53ef1dea7427   4 seconds ago   6.11MB
busybox      latest    3fbc63216742   5 seconds ago   6.09MB
<none>       <none>    a2b5f145d9d2   5 seconds ago   6.09MB
$ docker images
REPOSITORY   TAG       IMAGE ID       CREATED         SIZE
-asdf         latest    59da756a8eb8   4 seconds ago   6.11MB
-<none>       <none>    53ef1dea7427   4 seconds ago   6.11MB
-busybox      latest    3fbc63216742   5 seconds ago   6.09MB
-<none>       <none>    a2b5f145d9d2   5 seconds ago   6.09MB
+asdf         latest    59da756a8eb8   1 second ago    6.11MB
+busybox      latest    3fbc63216742   2 seconds ago   6.09MB
```


Also `TestBuildMultiStageArg` and `TestBuildMultiStageGlobalArg`.

**- Description for the changelog**
<!--
Write a short (one line) summary that describes the changes in this
pull request for inclusion in the changelog:
-->


**- A picture of a cute animal (not mandatory but encouraged)**


daemon/containerd/image_tag.go
package containerd

import (
	"context"

	cerrdefs "github.com/containerd/containerd/errdefs"
	containerdimages "github.com/containerd/containerd/images"
	"github.com/containerd/containerd/log"
	"github.com/distribution/reference"
	"github.com/docker/docker/api/types/events"
	"github.com/docker/docker/errdefs"
	"github.com/docker/docker/image"
	"github.com/pkg/errors"
)

// TagImage creates an image named as newTag and targeting the given descriptor id.
func (i *ImageService) TagImage(ctx context.Context, imageID image.ID, newTag reference.Named) error {
	target, err := i.resolveDescriptor(ctx, imageID.String())
	if err != nil {
		return errors.Wrapf(err, "failed to resolve image id %q to a descriptor", imageID.String())
	}

	newImg := containerdimages.Image{
		Name:   newTag.String(),
		Target: target,
	}

	is := i.client.ImageService()
	_, err = is.Create(ctx, newImg)
	if err != nil {
		if !cerrdefs.IsAlreadyExists(err) {
			return errdefs.System(errors.Wrapf(err, "failed to create image with name %s and target %s", newImg.Name, newImg.Target.Digest.String()))
		}

		replacedImg, err := is.Get(ctx, newImg.Name)
		if err != nil {
			return errdefs.Unknown(errors.Wrapf(err, "creating image %s failed because it already exists, but accessing it also failed", newImg.Name))
		}

		// Check if image we would replace already resolves to the same target.
		// No need to do anything.
		if replacedImg.Target.Digest == target.Digest {
			i.LogImageEvent(imageID.String(), reference.FamiliarString(newTag), events.ActionTag)
			return nil
		}

		// If there already exists an image with this tag, delete it
		if err := i.softImageDelete(ctx, replacedImg); err != nil {
			return errors.Wrapf(err, "failed to delete previous image %s", replacedImg.Name)
		}

		if _, err = is.Create(context.Background(), newImg); err != nil {
			return errdefs.System(errors.Wrapf(err, "failed to create an image %s with target %s after deleting the existing one",
				newImg.Name, imageID.String()))
		}
	}

	logger := log.G(ctx).WithFields(log.Fields{
		"imageID": imageID.String(),
		"tag":     newTag.String(),
	})
	logger.Info("image created")

	defer i.LogImageEvent(imageID.String(), reference.FamiliarString(newTag), events.ActionTag)

	// The tag succeeded, check if the source image is dangling
	sourceDanglingImg, err := is.Get(context.Background(), danglingImageName(target.Digest))
	if err != nil {
		if !cerrdefs.IsNotFound(err) {
			logger.WithError(err).Warn("unexpected error when checking if source image is dangling")
		}

		return nil
	}

	// Delete the source dangling image, as it's no longer dangling.
	if err := is.Delete(context.Background(), sourceDanglingImg.Name); err != nil {
		logger.WithError(err).Warn("unexpected error when deleting dangling image")
	}

	return nil
}

package containerd

import (
	"context"

	cerrdefs "github.com/containerd/containerd/errdefs"
	containerdimages "github.com/containerd/containerd/images"
	"github.com/containerd/containerd/log"
	"github.com/distribution/reference"
	"github.com/docker/docker/api/types/events"
	"github.com/docker/docker/errdefs"
	"github.com/docker/docker/image"
	"github.com/pkg/errors"
)

// TagImage creates an image named as newTag and targeting the given descriptor id.
func (i *ImageService) TagImage(ctx context.Context, imageID image.ID, newTag reference.Named) error {
	target, err := i.resolveDescriptor(ctx, imageID.String())
	if err != nil {
		return errors.Wrapf(err, "failed to resolve image id %q to a descriptor", imageID.String())
	}

	newImg := containerdimages.Image{
		Name:   newTag.String(),
		Target: target,
	}

	is := i.client.ImageService()
	_, err = is.Create(ctx, newImg)
	if err != nil {
		if !cerrdefs.IsAlreadyExists(err) {
			return errdefs.System(errors.Wrapf(err, "failed to create image with name %s and target %s", newImg.Name, newImg.Target.Digest.String()))
		}

		replacedImg, err := is.Get(ctx, newImg.Name)
		if err != nil {
			return errdefs.Unknown(errors.Wrapf(err, "creating image %s failed because it already exists, but accessing it also failed", newImg.Name))
		}

		// Check if image we would replace already resolves to the same target.
		// No need to do anything.
		if replacedImg.Target.Digest == target.Digest {
			i.LogImageEvent(imageID.String(), reference.FamiliarString(newTag), events.ActionTag)
			return nil
		}

		// If there already exists an image with this tag, delete it
		if err := i.softImageDelete(ctx, replacedImg); err != nil {
			return errors.Wrapf(err, "failed to delete previous image %s", replacedImg.Name)
		}

		if _, err = is.Create(context.Background(), newImg); err != nil {
			return errdefs.System(errors.Wrapf(err, "failed to create an image %s with target %s after deleting the existing one",
				newImg.Name, imageID.String()))
		}
	}

	logger := log.G(ctx).WithFields(log.Fields{
		"imageID": imageID.String(),
		"tag":     newTag.String(),
	})
	logger.Info("image created")

	defer i.LogImageEvent(imageID.String(), reference.FamiliarString(newTag), events.ActionTag)

	// The tag succeeded, check if the source image is dangling
	sourceDanglingImg, err := is.Get(context.Background(), danglingImageName(target.Digest))
	if err != nil {
		if !cerrdefs.IsNotFound(err) {
			logger.WithError(err).Warn("unexpected error when checking if source image is dangling")
		}

		return nil
	}

	builderLabel, ok := sourceDanglingImg.Labels[imageLabelClassicBuilderParent]
	if ok {
		newImg.Labels = map[string]string{
			imageLabelClassicBuilderParent: builderLabel,
		}

		if _, err := is.Update(context.Background(), newImg, "labels"); err != nil {
			logger.WithError(err).Warnf("failed to set %s label on the newly tagged image", imageLabelClassicBuilderParent)
		}
	}

	// Delete the source dangling image, as it's no longer dangling.
	if err := is.Delete(context.Background(), sourceDanglingImg.Name); err != nil {
		logger.WithError(err).Warn("unexpected error when deleting dangling image")
	}

	return nil
}

Not a blocker, but it's a common pattern to inline these (when `ok` vars are involved); also in some cases this helps making it clear a variable is locally-scoped to the condition ("look no further; it's only used here").

```go
	if builderLabel, ok := sourceDanglingImg.Labels[imageLabelClassicBuilderParent]; ok {
```