In fact, no program can prevent that.
This has also nothing to do with 'privacy' though.
Using an IM program and setting yourself 'online' implies that everybody who is on your contactlist can see you as 'online' and can see you logging on and off, that is the whole essence of being online...
'Invading privacy' are things like checking what your contact is saying to someone else without that contact knowing about it.