SIXTH AMENDMENT TO MASTER REPURCHASE AND SECURITIES CONTRACT AND CONSENT TO RESTRUCTURING