There are a variety of reasons that your hearing this "whistling sound". Here are a few that are listed online to help you analyze your specific situation.
(1) The whistle is so the guy who is filling the tank gets a warning
before it overflows.
The original poster was posting from Canada-- but I'm from NY & it has
been required here for at least 30 years.
They appear to be required in many area's these days to help protect everyone who is working on or living with a gas water heater. They are usually part of the vent pipe &unless you're right there and listening for it, you might never associate the whistling with the vent.
(2) The pressure in your gas line is well under a pound per square inch (by comparison the pressure in your car's tires are 30 pounds per square inch). If you had a gas leak, you probably wouldn't hear any kind of noise or it would be very, very faint. If you had a leak where you could hear noise, you would definitely smell it.
I'd be more inclined to think that you have a small water leak at the bottom of the tank and the noise you hear is the water boiling off. Does the whistling sound decrease as the water heats