The liberty of any person supposed to be mentally ill shall not be restrained by any person not acting under the authority of the county board of mental health except to the extent for the period that may be necessary for the safety of persons and property, and until authority can be obtained.