Section 18. The probate court in which the action for divorce is pending may, upon petition of the wife, prohibit the husband, or upon petition of the husband, prohibit the wife from imposing any restraint upon her or his personal liberty during the pendency of the action for divorce. Upon the petition of the husband or wife or the guardian of either, the court may make such further order as it deems necessary to protect either party or their children, to preserve the peace or to carry out the purposes of this section relative to restraint on personal liberty.