stockpules: fix protobuf-lite support

Looks like we lost more than just TextFormat when we lost full protobuf
support. Copied these two serialization functions over.