Fixes issue 122: SML read deadlock

This pull request mainly fixes the a read deadlock of the SML plugin (see issue #122). 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