Three causes:-
1) Pilot light partially blocked making an unstable flame which easily blows out when the main burner shuts down--If pilot has a yellow tinged flame, clean it out
2) Pilot flame too low & not staying in contact with thermocouple probe--Adjust pilot size.
3) Early sign of the thermocouple begining to fail.--replace it.
Cledlyn
September 2008