Fixed gethostbyname_r check. Included CheckPrototypeDefinition since its not available until CMake 2.8
Fix compilation on Linux/GNU platforms.