A fix and a test case for Tarantool ticket gh-296

Make sure tp.h compiles as a C++ header.
Add a test case.