I've looked for a free program to do this forever and have yet to find one, however a quick fix would be to simply get a male-mail 3.5mm headphone cord (one with a headphone jack on both ends, like the ones used to connect a computer to a set of speakers) and plug one in into your head phone jack and the other into your line in jack and record it that way.
Audacity should be able to do that for you. In fact now that I think about Audacity might be able to do what you wanted to do in the first place...