plug-ins: multi-layer support in PSD load/export.

- Store the Layer ID (lyid) block. Use GIMP's layer tattoo as a PSD
  layer ID, hence mirroring PSD load processing (we were already reading
  this block into our layer tattoos but always exporting with no ID).
- Add support for the Layer Selection ID(s) block (0x042D) both on
  import and export in order to store and restore the multi-layer
  selection.
  We were previously using the Layer state information block (0x0400) to
  store the active layer, but it doesn't seem to be usable for multiple
  layer selection. Actually it is even doubtful if this was working fine
  even for single layer selection but I can't be sure (I could only test
  in non-Photoshop software available to me). So the new logics is:
  * If more than 1 layer is selected, store only the Layer Selection
    ID(s) block.
  * If exactly 1 layer is selected, store both the Layer Selection ID(s)
    and Layer state information blocks.
  * Otherwise (no layers selected) do not store any of these blocks.
16 jobs for wip/Jehan/PSD-multi-layer in 36 minutes and 27 seconds (queued for 2 seconds)
Status Name Job ID Coverage
  Prepare
passed build-image #1174584

00:01:19

passed build-image-win32 #1174586

00:01:03

passed build-image-win64 #1174585

00:01:55

 
  Dependencies
passed deps-debian #1174587

00:02:42

passed deps-win32 #1174589

00:06:23

passed deps-win64 #1174588

00:14:40

 
  Gimp
passed gimp-autotools-debian #1174590

00:08:23

passed gimp-clang-debian #1174593

00:04:19

passed gimp-distcheck-debian #1174591

00:23:07

passed gimp-meson-debian #1174592

00:03:52

passed gimp-win32 #1174595

00:13:22

passed gimp-win64 #1174594

00:10:36

 
  Analysis
passed cppcheck #1174596

00:02:15

 
  Distribution
passed sources #1174597

00:02:26

passed win32-nightly #1174599

00:11:07

passed win64-nightly #1174598

00:09:12