[M150] Address incorrect handling of a map pointer in SkRP

Original change's description:
> Address incorrect handling of a map pointer in SkRP
>
> In pushChildCall, we held on to a pointer from a fChildEffectMap
> and then later dereferenced it. However, in between those
> points was a code path that could grow the map, invalidating
> the pointer. This is demonstrated in the newly added test.
>
> To fix it, we just dereference it earlier. While tracking this
> down, I found a suspicious other usage of the map which works
> in newer C++, but could break in older versions. It's trivial
> to fix Generator::writeFunction, so I handled that as well.
>
> Bug: b/540157141
> Fixed: 540157141
> Change-Id: I149b070c31d4cfefa65b30972f0b8b94441e66db
> Reviewed-on: https://skia-review.googlesource.com/c/skia/+/1308776
> Reviewed-by: Jorge Betancourt <jmbetancourt@google.com>
> Commit-Queue: Kaylee Lubick <kjlubick@google.com>

(cherry picked from commit 5b90a364a9693ed275ba5a99c7ce35f9ea3243b4)

Bug: 541110610,b/540157141,540157141
Change-Id: I149b070c31d4cfefa65b30972f0b8b94441e66db
Reviewed-on: https://skia-review.googlesource.com/c/skia/+/1311197
Auto-Submit: Chrome Cherry Picker <chrome-cherry-picker@chops-service-accounts.iam.gserviceaccount.com>
Commit-Queue: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
Bot-Commit: rubber-stamper@appspot.gserviceaccount.com <rubber-stamper@appspot.gserviceaccount.com>
2 files changed