The flame sensor, at the pilot flame is almost always the problem when you have pilot outage problems. When the flame goes out is it most likely because there is some air movement change when the flame goes down. HOWEVER you should never smell gas unless you are just light the pilot, or just lighting the burner, or just turning them off. If you smell gas when the pilot is off for a period of time, then you will need to replace the gas control valve. It is letting a small amount of gas through when there should be NONE.