Of the 50 most affordable and safest places to live, small Midwestern cities and towns got the highest ratings.