TWELFTH AMENDMENT TO MASTER WHOLE-LOAN PURCHASE AGREEMENT