[SPARK-3466] Limit size of results that a driver collects for each action

Right now, operations like collect() and take() can crash the driver with an OOM if they bring back too many data.

This PR will introduce spark.driver.maxResultSize, after setting it, the driver will abort a job if its result is bigger than it.

By default, it's 1g (for backward compatibility for most the cases).

In local mode, the driver and executor share the same JVM, the default setting can not protect JVM from OOM.

cc @mateiz 
It's kind of weird that we send a new type of result (TooLargeTaskResult) in this case instead of failing the task. On the web UI, the task will look like it completed, but then the job will abort. Is there a way we could fail the task instead, and send a special TaskFailedReason that says the result is too large? Then the TaskSetManager can abort when it sees that, the same way it does for FetchFailed.