Looping like that through the headphone jack won't work, since the track you are recording also goes to the headphone out, causing your feedback.
Might be able to pan the first track hard left, and the recorded track hard right, and use a mono cable from the headphone jack (or one of the line outs) so that the track being recorded is not sending a signal to the line it is recording from.