Fix strdup, strrchr, strfree and ddi_copyin/out