The thing is, the more you let it rattle the more it will slowly but surely wear away at the headlight housing, so it will basically only get worse with time, it's not gonna go away.
And I'd imagine the worse it gets it will vibrate the hell out of the bulb and probably end up breaking a filament, plus it's bloody annoying anyway.