python subprocess stdout read hangs