This may be a little more technical than you want.
The ebrake warning lamp staying on when the parking brake is released is an indicator of two things. 1) low brake fluid 2) electrical malfunction in the system
As yours is not staying on when the ebrake is released, but rather coming on while you are driving AND being mechanically related to the position of hand brake lever, it is apparent that the failure is in the mechanical "tripping" of the switch.
This switch is the very same type as the one in the door of your oven, a "plunger" type switch, that reacts according to the position of the plunger. However, it works in reverse of the one in your oven door. When extended, the switch connects the circuit and the light is on. When compressed, the circuit is opened and the light goes of. The switch is mounted below the lever handle, so when you release the brake and lower the lever handle, the switch is plunger is pushed in. Something is causing that action to act erratic, either the switch is bad, the mounting of the switch is loose, the lever handle is loose or it's pivoting mechanism is worn. The switch lookes something like this

I can tell you with a certain amount of surety that nothing else is malfunctoning and there is no impending danger. To the best of my knowledge the switch is not adjustable, however, that said, I suppose the adjustment of the cables to the brakes themselves, which causes the tension on the lever, could need adjusting, and this, in turn, could cause the lack of enough pressure on the switch to "trip" it. Perhaps someone who has dealt with this specific issue can offer more insight.
MORAV
Technically speaking...
.