fdo#72874: Strip const-ness from pointer value when setting it to storage.

Else the pointer type would get demoted to a boolean type which would cause
the boolean version of overloaded function to get picked.

Change-Id: Ided7e8c67ef84b4323c8ad1123e0a2c30ce37e01
(cherry picked from commit 21f053e2dd2867489a4d5823d9210c4368f4d115)