The attachment for contempt shall be immediately served, by arresting the party charged, and bringing him or her into court, if in session, to be dealt with as in other cases of contempt; and the court shall also take all necessary measures to secure and indemnify the plaintiff against damages in the premises.