Resonant Activation and Noise Enhanced Stability in Josephson junctions