string: Improve generic strrchr with memrchr and strlen