It's very simple why the iPhone sales are flat, the OS does not need super powered spec's to run smoothly, like Android needs, people keeping their phones longer.
I know a lot of non tech people, that are iPhone fans, a ton of them still with iPhone 5 or 5S's, and I ask why didn't they upgrade yet, and every one of them has the same answer. Upgrade for what ? This phone still works perfectly fine, no problem with it, does everything I need it to do. They all say they will upgrade when the phone breaks, or becomes super bogged down and slow.
All of these people have very good jobs, are professionals, and can easily afford to drop $1,000 on a new phone in a heartbeat if needed. But they just don't think about it like we tech geeks on forums like this. If it aint broke, don't fix it attitude. I see these people keeping their phones on average 3+ years or so.
I think smartphones have gotten so fast the past couple of years, the yearly or even two year upgrade cycle for the average Joe isn't needed. Plus with the economy still being ok, not everyone is a millionaire yet, people will hold onto their $800 phone for longer.