Fixed bug that could cause connection to close prematurely.

Fixed an segmentation fault in case of exiting XBMC.

Corrected version number
Merge pull request #300 from sub3/master

Fixed bug that could cause connection to close prematurely.