Cleaned up the imports, and changed the lock to a pointer so it is
consistent with other member variables. Fixed a leak on the pollthread,
which is now deleted in closePort() (called by the Destructor if not
done explicitly by the user).