A founder shares how the first 12 months of his startup nearly fell apart — and the hard lessons that ultimately saved the business.