Codec for testing that throws random IOExceptions