std.stdio: improve standardization of C I/O functions across runtimes

Standardize the primary C I/O functions into a common (GCC) interface:
- fgetc_unlocked, fgetwc_unlocked
- fputc_unlocked, fputwc_unlocked
- flockfile, funlockfile

On OSX/FreeBSD, use provided fgetc_unlocked/fputc_unlocked functions instead of using the locked versions internally (may increase performance for narrow streams).