Add CMake detection for getopt.h and update json_parse.c to include it only when HAVE_GETOPT_H is defined. Fixes AIX build failure.