Apply patch to resolve CASSANDRA-8285

Issue: https://issues.apache.org/jira/browse/CASSANDRA-8285
Patch link:
https://issues.apache.org/jira/secure/attachment/12685610/8285-v2.txt

This patch is to reduce OOM errors we are seeing that are being caused
by the flushwriter being blocked.
Apply patch from CASSANDRA-8164 to fix OOME

Issue: https://issues.apache.org/jira/browse/CASSANDRA-8164
Patch:
https://issues.apache.org/jira/secure/attachment/12676357/OOMWhileMemoryMetering.txt

We're running into OOME issues, and this is an upstream fix for another
OOME issue we may be running into. Apply it too.