Fix crash when using --trace 10 or above

`uint8_t` is typedef'd to char, thus `boost::lexical_cast` treats it
as such instead of a number.

I've had an insightful chat in the #boost channel and this seems to me the best solution.
Another approach could be to use [stoul](http://en.cppreference.com/w/cpp/string/basic_string/stoul) from C++11, which is generally more efficient, but doesn't explicitly support `uint8_t` either.
(Kudos to VeXocide in #boost)

I chose `boost:lexical_cast<uint16_t>` over `stoul` to keep the changes as small as possible,
but would be willing to change this pull request to use `stoul` if that's preferred.