The code would fail to compile because the property would not be seen as
used and would be removed, but not the change callback.
Fixes#8269
Also fix a segfault in the added test because it will initialize the
change callback (and therefore query the properties) because the
SharedGlobal structure is fully initialized.
So we must only initialize the change callback on global after the
SharedGlobal is fully initialized
If the property was not used, it was optimized out and the compiler
would panic
Fixes#6331
ChangeLog: compiler: Fix changed callback of an unused property
We sometimes generate dead code or unused variables for our expressions.
Most code is already covered with the `#[allow]`, so we need to also
allow it for callbaks