build: fix volatile compatible-pointer-types warnings

Happens when compiling with GCC 11
7 jobs for volatile-fix in 2 minutes and 8 seconds (queued for 31 seconds)
Status Name Job ID Coverage
  Container
passed container_fedora #12895793

00:00:33

passed container_ubuntu #12895794

00:00:14

 
  Build
passed build_on_fedora_no_docs #12895796

00:01:34

passed build_on_fedora_with_docs #12895795

00:00:39

passed build_on_fedora_wpipc #12895797

00:00:46

passed build_on_ubuntu_no_gir #12895799

00:00:34

passed build_on_ubuntu_with_gir #12895798

00:00:53