fix vipsthumbnail

with input cmyk and output rgb profiles both specified ... it was
importing twice, causing a band mismatch

see

https://github.com/jcupitt/libvips/issues/177
fix vipsthumbnail with broken embedded profiles

if the embedded profile is broken or incompatible with the specified
output profile, retry with the specified input profile

see

https://github.com/jcupitt/libvips/issues/178
Merge branch '7.40'