Jails struggle to deal with flood of mentally ill