A person commits a disorderly persons offense if he knowingly restrains another unlawfully so as to interfere substantially with his liberty. In any prosecution under this section, it is an affirmative defense that the person restrained was a child less than 18 years old and that the actor was a relative or legal guardian of such child and that his sole purpose was to assume control of such child.