Most of the Jewish community fled in the early 20th century, and Israeli-Azerbaijani relations have been a damper, but ancient ties and renewed diplomacy sow hope for the future