Restore missing check for flockfile and getc_unlocked

(cherry picked from commit 7eea7568)
39 jobs for !1654 with ondrej/restore-flockfile-check-v9_14 in 11 minutes and 29 seconds (queued for 3 seconds)
merge request