workaround to build on GHC 7.8.3 Win64

The use of `strdup` causes an build failure on latest GHC(https://ghc.haskell.org/trac/ghc/ticket/9215). Here is a workaround to fix it.