Add lint for unused lifetimes

A step towards  #12805.