update vips to latest stable, 7.40.4

this set of minor fixes help the ruby-vips gem pass all spec tests, see:

https://github.com/jcupitt/libvips/blob/master/ChangeLog

Closes #1064.