**Describe the bug**
I've found that quantileDeterministic and relevant functions are not deterministic

On 21.2.3 release:
```sql
SELECT medianDeterministic(oid, oid) FROM ztf.dr4_meta

┌─medianDeterministic(oid, oid)─┐
│               686709400040570 │
└───────────────────────────────┘

SELECT medianDeterministic(oid, oid) FROM ztf.dr4_meta

┌─medianDeterministic(oid, oid)─┐
│               686315850035097 │
└───────────────────────────────┘

SELECT medianDeterministic(oid, oid) FROM ztf.dr4_meta

┌─medianDeterministic(oid, oid)─┐
│               686316400060683 │
└───────────────────────────────┘
```

**Does it reproduce on recent release?**
Yes

**How to reproduce**
* Which ClickHouse server version to use: 21.2.3
* `CREATE TABLE` statements for all tables involved
```sql
CREATE TABLE dr4_meta
(
    `oid` UInt64 CODEC(Delta(8), LZ4),
    `nobs` UInt16 CODEC(T64, LZ4),
    `ngoodobs` UInt16 CODEC(T64, LZ4),
    `filter` UInt8 CODEC(T64, LZ4),
    `fieldid` UInt16 CODEC(T64, LZ4),
    `rcid` UInt8,
    `ra` Float64,
    `dec` Float64,
    `h3index10` UInt64,
    `durgood` Float64,
    `mingoodmag` Float32,
    `maxgoodmag` Float32,
    `meangoodmag` Float32
)
ENGINE = MergeTree()
ORDER BY oid
```
* Sample data for all these tables, use [clickhouse-obfuscator](https://github.com/ClickHouse/ClickHouse/blob/master/programs/obfuscator/Obfuscator.cpp#L42-L80) if necessary
[100GB tar](https://drive.google.com/file/d/1lRqzJx650MrTuY8SGfMTO9E_5U8xldL-/view?usp=sharing) of dr4_meta table

**Additional context**
20.6.4.1 works fine and always return `686316400060683`, while current version returns this or some other values. If `max_threads=1` is applied current version always returns `686709400040570`
{
struct Settings;
namespace ErrorCodes
{
    extern const int LOGICAL_ERROR;
}
}
namespace DB
{
struct Settings;
namespace ErrorCodes
{
    extern const int MEMORY_LIMIT_EXCEEDED;
}
}
namespace detail
{
    const size_t DEFAULT_MAX_SAMPLE_SIZE = 8192;
    const auto MAX_SKIP_DEGREE = sizeof(UInt32) * 8;
}
enum class ReservoirSamplerDeterministicOnEmpty
{
    THROW,
    RETURN_NAN_OR_ZERO,
};
template <typename T,
    ReservoirSamplerDeterministicOnEmpty OnEmpty = ReservoirSamplerDeterministicOnEmpty::THROW>
class ReservoirSamplerDeterministic
{
    bool good(const UInt32 hash)