[libpng17] Port recent /*SAFE*/ comments and manual changes from libpng16