stack: add missing includes, include guard