delphi: Use getaddrinfo instead of gethostbyname on Mac OS X

Because gethostbyname seems to be missing in Delphi XE3.
red-brick: Split error code range into redapid specific and errno mapping codes
red-brick: Add create_directory function
red-brick: Start adding program object API