Fixes issue 112: SML read deadlock

This pull request mainly fixes the a read deadlock of the SML plugin (see issue #112). There are some other features and fixes implemented in this pull request:
* make static members instance members (preparation for multiple plugin registrations)
* implement read re-try of 5 times when error occurred while reading from socket/network
* improve error handling