shared_ptr comparisions to nullptr for c++11

c++11 supports explicit operator bool, which is used by newer boost if
c++11 is enabled, breaking the implicit conversions. A comparision to NULL
is used instead
[appmessenger] make ThreadMessage's parameters signed integers