Safe hasOwnProperty