Fix checks for valid integer range subset of 'double'.
Previously, I assumed that checking that a 'double' was between LONG_MIN
and LONG_MAX meant that it would convert to a sensible 'long'. This is
wrong, because LONG_MAX rounds up to a higher 'double', because it has too
many bits for a 53-bit mantissa. This could cause problems, like for
example LONG_MAX (as a double) turns out to convert back to LONG_MIN (as a
'long'). This commit fixes the problem.
Thanks to Youngseok Choi for reporting the problem.
Reported at https://lists.gnu.org/archive/html/bug-gnu-pspp/2023-04/msg00005.html.