Allocate a PATH_MAX-sized buffer on stack only in case we are not using
realpath(X, null), i.e. on platforms with older POSIX versions, macOS,
or Android.
This fixes the build on platforms that do not have PATH_MAX (e.g.
GNU/Hurd), and it provides a minor optimization on realpath(X, null)
platforms.
Change-Id: Icd92a1b15ec18c5eef8113408e9610dfac774101
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>