Fix string_copyn() for limit greater than actual string length