Correlated optimized effective-potential treatment of the derivative discontinuity and of the highest occupied Kohn-Sham eigenvalue: A Janak-type theorem for the optimized effective-potential model