It is the right of the witness to be protected from irrelevant, insulting, or improper questions or from harsh or insulting demeanor; to be detained only so long as the interests of justice require it; and to be examined only as to matters legal and pertinent to the issue.