Add a function to get the `Main *bmain` pointer from a LibraryForeachIDData struct. Since the struct is opaque to the `..._foreach_id` functions, a separate function like this is necessary to get that pointer. Not used yet, but will be in a followup commit. Pull Request: https://projects.blender.org/blender/blender/pulls/123187