Correlated thermal fluctuations in short and long Josephson junctions