A Thermo-resistive Tearing Mode Model of the Density Limit in Tokamaks