ptr_valid: fix warn-unused-result warning (-O2)