An Oakland nonprofit is buying an apartment building to rent to teachers - for below-market rates.