The smallest prime in a conjugacy class and the first sign change for automorphic $L$-functions