better file format sniffing

and vips_error_freeze/thaw() to stop errors from sniffing
being logged

plus better matrix sniffing