Safety about windows
First, get your possible gas leak checked out right away. Call the gas utility company that services your house and ask them to come and check for a leak. Most gas companies will do this for free and quickly, because it is not good for business when their product kills people. If you suspect any gas leak at all, you should get it checked.

Second, whether your security bars are actually secure depends on how they are installed. Are they fastened securely? If you have a sash window like the one in the picture, usually both sashes can be moved up and down, but it's possible that in your installation the upper sash was not designed to move or has been fastened in place.

Regarding closing windows on upper floors for safety: usually only ground-floor windows need to be secured, as thieves tend to look for the easiest opportunity, and the challenge of climbing into an upper story window probably isn't worth it. Take a walk around your house, think about the top few ways you might get in if you lost your keys, and secure those things first. And let yourself enjoy a little fresh air at night. :)