"a court must review the detention as soon as reasonably possible but no later than days after the date the person was detained and the court must release the detainee unless it is necessary to continue the detention to restore peace and order"