Read all command responses of a pipeline

Otherwise a error makes the responses stuck in the socket. Which leads to wrong
responses for the following commands
Add python3 and python2.5 compatibility
Merge pull request #338 from stephan-hof/corrupted_pipeline_socket

socket gets corrupted if errors in pipeline happen