[WIP/RFC] Add unit tests for buffer.c and fileio.c

MAXPATHL is system specific, so os_unix_defs.h is more or less the right place for Unix `right now`. From #850 there is also os/unix_defs.h and os/win_defs.h (these would be the right place to put MAXPATHL) and including os/os_defs.h in globals.h maybe?