Windows - no strndup

Sadly Windows doesn't know strndup and can't compile it.
Maybe defining our own strndup routine saves the day for Windows users.