Coalition narrowly avoids Lords defeat on pension changes