it is possible to have headache during and after some time of masturbation
it is normal thing ,u need not to worry about it.
due to exercise and increase blood flow pain and heavyness can be feel.
be relax and do not do it for too many times.
drink more water and avoid salt in ur diet