Fix fgets_unlocked namespace issues (bug 17664).