### ImageMagick version

7.1.1-27

### Operating system

Windows

### Operating system, version and so on

Windows 10

### Description

```
identify.exe "-format" "%[exif:*]" Sample_abc.jpg
```

erroneously returns a trailing comma after some entries

Example:

```
exif:ColorSpace=1,
exif:DateTime=2008:02:08 15:39:41
exif:ExifOffset=164,
exif:Orientation=1,
exif:PixelXDimension=420,
exif:PixelYDimension=315,
exif:ResolutionUnit=2,
exif:Software=Adobe Photoshop CS3 Macintosh
exif:thumbnail:Compression=6,
exif:thumbnail:JPEGInterchangeFormat=302,
exif:thumbnail:JPEGInterchangeFormatLength=2896,
exif:thumbnail:ResolutionUnit=2,
exif:thumbnail:XResolution=72/1
exif:thumbnail:YResolution=72/1
exif:XResolution=720000/10000
exif:YResolution=720000/10000
```

### Steps to Reproduce

```
identify.exe "-format" "%[exif:*]" Sample_abc.jpg
```

### Images

![Sample_abc](https://github.com/ImageMagick/ImageMagick/assets/34310154/dcadbc24-f3d6-41a2-a856-d97c2400b74d)

identify.exe output format error
This is a GitHub Issue
repo:ImageMagick
owner:ImageMagick
Title : identify.exe output format error
Issue date:

--- start body ---
### ImageMagick version

7.1.1-27

### Operating system

Windows

### Operating system, version and so on

Windows 10

### Description

```
identify.exe "-format" "%[exif:*]" Sample_abc.jpg
```

erroneously returns a trailing comma after some entries

Example:

```
exif:ColorSpace=1,
exif:DateTime=2008:02:08 15:39:41
exif:ExifOffset=164,
exif:Orientation=1,
exif:PixelXDimension=420,
exif:PixelYDimension=315,
exif:ResolutionUnit=2,
exif:Software=Adobe Photoshop CS3 Macintosh
exif:thumbnail:Compression=6,
exif:thumbnail:JPEGInterchangeFormat=302,
exif:thumbnail:JPEGInterchangeFormatLength=2896,
exif:thumbnail:ResolutionUnit=2,
exif:thumbnail:XResolution=72/1
exif:thumbnail:YResolution=72/1
exif:XResolution=720000/10000
exif:YResolution=720000/10000
```

### Steps to Reproduce

```
identify.exe "-format" "%[exif:*]" Sample_abc.jpg
```

### Images

![Sample_abc](https://github.com/ImageMagick/ImageMagick/assets/34310154/dcadbc24-f3d6-41a2-a856-d97c2400b74d)

--- end body ---

None