Add strndup implementation for systems with lack of it

Solaris 10 FCS (first release) does not have strndup implementation.