Were early military planes not pressurized?
There were a few problems:


Pressurization (while not impossible) was difficult requiring extra effort. It also increased weight and complexity.
Pressurization was still a relatively new technology at the time. For reference, the first pressurized commercial aircraft, the Boeing 307 Stratoliner, made its first flight later the same year (1938) as the B17. Note that it was developed from the B17.
There was an incredible amount of openings on early planes for gun turrets, bomb bays, etc. Sealing these off airtight would have been a impractical nightmare. You would traverse the bomb bay move to the back and front of the plane.
It's also better from a reliability standpoint- it's pretty easy to damage and make a hole in the fuselage, but everybody having their own oxygen masks removes that single point of failure. 
While perhaps (I imagine) not incredibly comfortable for long duration missions oxygen masks worked fine.


30,000ft corresponds to around 9,200m, although that altitude is a ceiling defined by Boeing. With full load, they never achieved those altitude and hung around a lot lower. While I can't verify it, these forum posters appears to suggest that 19,000ft-28000ft with bombs was more common.

To do the math, the partial pressure of oxygen at sea level is around 0.21 bar. If you're being fed 100% oxygen through your mask, this is the same pressure as at 11,000m.


Photo by Margaret Bourke-White, Sept. 1942, from the LIFE Archives.