The electronics retailer’s miraculous turnaround offers an important lesson to shuls combating dwindling attendance