Some fixes to WebP related build scripts

We were able to compile darktable when WebP wasn't found just because of
a bug in the WebP detection code.