Fixed issue with background polling thread not getting deleted.
Merge pull request #37 from gwynantj/Threading

Fixed issue with background polling thread not getting deleted.