Replace posix strdup with c standard strlen/malloc/memcpy

On MSVC the strdup implmentation differs from the posix version causing a
heap violation error when the resulting string is freed.
Merge pull request #348 from TheCycoONE/msvc_strdup_errors

Replace posix strdup with c standard strlen/malloc/memcpy