Fix socket errors: buffer Apertium stdout

Change-Id: I53bbc76df0099e092b92fee5a186a370f2dbe744