metadata: do not use grabber cache if not initialised

There’s no guarantee that a non-static member will be initialised.
Make all global variable static, there is no reason to export them

Fix #12206 part 2