Fix a segfault error in realpath() for NetBSD. VERY THANKS to Timothy Lee Roden for reporting this bug.