Is a gas water heater safe in a bedroom?
The amount of oxygen consumed by a hot water heater is negligible. The risk of the gas heater sucking all the oxygen out of the room is zero. Now that does not mean that it's code to have it in a bedroom, but there is no safety issue from consumption of oxygen. 

The safety issue is on venting of the carbon monoxide (CO) from the hot water heater. In order to make the install safe, ensure that the new gas water heater is properly vented through the ceiling. There are lots of resources online about properly venting gas appliances. Here's a reasonable one to start with. 

Obviously since a gas hot water heater requires adding a vent, it's more expensive to install. You may find that an electric water heater still makes financial sense once you consider installation costs. 

As noted in the comments, be sure and get a CO detector for the room. These are relatively inexpensive and you can get them at your local hardware store or order through Amazon.