[config] fix auto:ffi probe for broken 3.1

define -DHAVE_LONG_DOUBLE_VARIANT=0 if the cflags include "libffi-3.1/include"
See https://github.com/atgreen/libffi/issues/125
fixes GH #1081.