Fix how the extension id is queried in our tests and examples


To avoid having an stale extension id the id should be queried on each
run and on the gui thread, or during the sync, if not it's possible for
the front-end object to have been destroyed, or that it has dynamically
swapped the back-end object (extension) that is being run.

Pick-to: 6.11
Change-Id: Ia43a2b237f60c003403d97f7eea82f569ac740ba
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
commit7bce6396873398225a7793255ed7d34be81b7e5e
parenta4aea74e7b828566196d389f314dd7ec93a367de
authorChristian Strømme <christian.stromme@qt.io>
committerChristian Strømme <christian.stromme@qt.io>
commit timeWed, 4 Feb 2026 18:42:08 +0100