BUG? pinMode() not retaining HIGH/LOW states through changes.

I just spent an evening hashing out a Due specific issue with the author of the AccelStepper library.(AccelStepper: AccelStepper library for Arduino)

It seems that if one assigns the state of a pin as HIGH/LOW then later on that pin changes from INPUT to OUTPUT the assigned HIGH/LOW state is reset to the default LOW.

Its probably no big deal if your pin was already set to LOW as the state is still the same, but if your counting on it to remember states while its output has been disabled then it might throw you a curve-ball.