Code would try to use a random ID as a legacy curve one, without any check on the actual ID type. When trying to open `tests/data/io_tests/blend_big_endian/2.30/dolphin.blend` recently added to our collection of regression tests, this ended up 'converting' a shapekey into a legacy curve ID, leading to invalid memory access detected by ASAN.