It's really hard to picture something like that evolving.
My own GUESS would be that the 17 year locust was originally designed as a signal of some sort, i.e. as a sign for some recurring event or celebration at 17-year intervals. I mean, if some biting fly or mosquito came out every 17 years you might figure it to be a microevolutionary adaptation but the locust is decorative like butterflies.