The prospect of its fall, following months of government gains elsewhere, has brought Assad closer to victory than at any point since the early months of a civil war that has killed hundreds of thousands and made half of Syrians homeless.