Fix insert-file-contents infloop with unlucky END
This partially reverts
55f41ca3aa8fe487d10730708a7396137a2c9d18,
which was a partial fix for Bug#77315.
* src/fileio.c (Finsert_file_contents): Go back to accepting
partial reads when doing the optimized way when code conversion is
not needed. This avoids an unlikely bug when END happens to lie
at a buffer boundary, causing an infloop. For consistency, do the
same when doing code conversion (though there’s no bug in then),
as there’s not a real need for emacs_full_read there either.
(cherry picked from commit
27e0f0f79b9c97796fc89fedf3c05517532f0475)