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

> Works for me. Wasn't sure if the moving MAXPATHL around was going to get complicated or not. Is there anything I need to change based on the discussion above?

The simplest way (moving it to `globals.h`) doesn't seem too complicated. Especially when put into a separate commit with a good subject and a little explanation. It's not ideal though, we'd need to move it to the respective `os_defs_*.h` file later. Ping @metrix78 and @equalsraf for that. So better add a `TODO`.