Change <base/fd.h> to use one centralized check to see if it is a system fd.

Unit test the system fd behavior.
Add utility to io_utils to check if the OS determine if an fd is valid