In any proceeding for criminal contempt arising under title II, III, IV, V, VI, or VII of this Act, the accused, upon demand therefor, shall be entitled to a trial by jury, which shall conform as near as may be to the practice in criminal cases. Upon conviction, the accused shall not be fined more than $1,000 or imprisoned for more than six months. This section shall not apply to contempts committed in the presence of the court, or so near thereto as to obstruct the administration of justice, nor to the misbehavior, misconduct, or disobedience of any officer of the court in respect to writs, orders, or process of the court. No person shall be convicted of criminal contempt hereunder unless the act or omission constituting such contempt shall have been intentional, as required in other cases of criminal contempt. Nor shall anything herein be construed to deprive courts of their power, by civil contempt proceedings, without a jury, to secure compliance with or to prevent obstruction of, as distinguished from punishment for violations of, any lawful writ, process, order, rule, decree, or command of the court in accordance with the prevailing usages of law and equity, including the power of detention.