Don't hold platform lock while calling user callbacks (#4027)

Inspired by a bug where using Edit -> Copy from the menu created a
deadlock.

Release Notes:

- Fix a deadlock when copying from Edit -> Copy
7c817642b8Conrad Irwin committed on 1/11/2024, 9:26:34 PM· committed by GitHubparentscb11fb6a8b8be4
1 file changedLine totals unavailable