Move definition of sysinfo::calc_hostname into sysinfo.cpp

It appears that boost/asio/ip/host_name.hpp somehow transitively includes
windows.h even though BOOST_USE_WINDOWS_H is not defined.

We move the usage of boost::asio into a cpp file to avoid including windows.h
in all TPIE headers.
Modernize ut-external_priority_queue

Use boost::mt19937 instead of TPIE_OS_RANDOM and size_t instead of
TPIE_OS_OFFSET.

This lets us get rid of the include of test_portability.h.
test/cat.cpp: Use ifstream instead of ::open, ::read and ::close
test/queue.cpp: Add missing include