Added popen_streambuf constructor which calls open()
Allocate Inventory on the stack
Use the new popen_streambuf constructor