GI DYNAMICS, INC. EIGHTH AMENDMENT TO NOTE PURCHASE AGREEMENT