fix check in MaybeSetFloatCallback, factor out duplicate code
fix check in MaybeSetFloatCallback, factor out duplicate code

libjxl/libjxl,libjxl/libjxl,libjxl/libjxl,libjxl/libjxl,libjxl/libjxl,libjxl/libjxl,libjxl/libjxl,libjxl/libjxl