make sure to select before each read call and expect JSON to be
ended by a line feed. This seems to be true for QMP and I hope it stays this way