#gpowerd Replace `std::move` with `std::exchange(..., nullptr)` for AnyInvocable

It is not guaranteed that `my_invocable` is empty after `std::move(my_invocable)`: https://screenshot.googleplex.com/4GXk4KEkrhJQfYn

This change ensures that AnyInvocable pointers are explicitly emptied after their ownership is transferred.

PiperOrigin-RevId: 839767009
Change-Id: Ic0ed00648b52e8f8413993e7ec8a91149de94905
3 files changed