### Godot version

v4.1.dev.custom_build [2e273f0e35800f2bcc7c05db54100caa97928f69]

### System information

Windows 11 x64, Vulkan (Forward+), NVIDIA GeForce GTX 1650

### Issue description

Importing EXR files from baking lightmaps will always fail. But the files aren't corrupted and can be opened in other software like Krita.

### Steps to reproduce

Do these in the MRP

1. Find `lm` node in the scene `000.tscn`, And press `Bake Lightmaps`
2. After finished baking, The lightmaps should be rendering normally and several error messages will be printed out. They say :
- Invalid/Corrupted data found when decoding pixels.
- Error loading image: res://000.exr
- Error importing 'res://000.exr'.

3. When trying to reopen `000.tscn`, The lightmaps won't render in the scene anymore.

( Optional )

4. If trying to put the lightmap data `000.lmbake` into the `lm` node. It will spam these out :
- Uniforms were never supplied for set (1) at the time of drawing, which are required by the pipeline
- Texture (binding: 7) is an array of (8) textures, so it should be provided equal number of texture IDs to satisfy it (IDs provided: 7).

Then all the meshes go black immediately.

### Minimal reproduction project

[i_5222a99f5_001.zip](https://github.com/godotengine/godot/files/11629095/i_5222a99f5_001.zip)

const char* type = "scanlineimage";
          if (exr_images[i].tiles) type = "tiledimage";
          WriteAttributeToMemory(
            &memory, "type", "string",
            reinterpret_cast<const unsigned char*>(type),
            static_cast<int>(strlen(type)));
        }
        
        {
          WriteAttributeToMemory(
            &memory, "chunkCount", "int",
            reinterpret_cast<const unsigned char*>(&chunk_count[i]),
            4);
        }
      }
      
      if (exr_headers[i]->num_custom_attributes > 0) {
        for (int j = 0; j < exr_headers[i]->num_custom_attributes; j++) {
          tinyexr::WriteAttributeToMemory(
            &memory, exr_headers[i]->custom_attributes[j].name,
            exr_headers[i]->custom_attributes[j].type,
            reinterpret_cast<const unsigned char*>(
              exr_headers[i]->custom_attributes[j].value),
            exr_headers[i]->custom_attributes[j].size);
        }
      }
      {  
        memory.push_back(0);
      }
    }