Even if it was just a magnet it still wouldn't go on forever. The second law of thermodynamics applies to everything, including permanent magnets.
In many physical (classical) systems there is a set of generalized coordinates of measure 0 which does not obey the 2nd law.
edit - think about the difference between having one big wave or millions of small ones that add up to the same energy as the big one. There is no energy difference between the two systems, but if you are standing on a cliff overlooking the sea, only the big one is going to get you wet.
edit - also, I went and had a bit more of a look and it turns out there is an energy difference between magnetised and demagnetised materials, but it is very small. One thing is that spontaneous magnetization happens and it wouldn't occur if the energy difference was large.
Is that not the case?