Revert compare_stream to stdlib 1.9.3 implementation