Prisoners with mental illness wait too long for beds