Onset of chaos in the rf-biased Josephson junction