[SPARK-3154][STREAMING] Make FlumePollingInputDStream shutdown cleaner.

Currently lot of errors get thrown from Avro IPC layer when the dstream
or sink is shutdown. This PR cleans it up. Some refactoring is done in the
receiver code to put all of the RPC code into a single Try and just recover
from that. The sink code has also been cleaned up.
Since you're changing `shutdownNow()` to `shutdown()` in SparkAvroCallbackHandler.scala, I'd suggest creating a dummy object and use `Object.wait()` here, and `Object.notifyAll()` in the shutdown method above, so that sleeping tasks are woken up.