windows: Provide a strndup(3) replacement