libraw: additional data checks backported from 0.15.4 (from lexa)
(cherry picked from commit 76ed400e6bfa510bf6d6a37831c669702c572ce0)