Changes to the drawings array require an update of the `drawing_index`
stored in frames. Subsequently the frame storage data (for writing to
files) also needs to be updated. This was missing in the
`remove_drawings_with_no_users` function, which can lead to invalid
`drawing_index` after loading the file again.
A regression test has been added for this case.
Also fixed a minor memory leak when all the drawings are removed.
The drawing array ends up empty but still has a pointer allocated.
Fixes should avoid this (nullptr when `drawing_array_num` is zero) but
also make sure the array pointer is handled anyway instead of assuming
nullptr.
Pull Request: https://projects.blender.org/blender/blender/pulls/118569