Work around EOFException in Avro

Apply patch from https://issues.apache.org/jira/browse/AVRO-813