fgetws_unlocked implementation.