xstrndup: Use strndup instead of implementing it.