[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.
Yeah, I realized that. It felt okay back then, but now that I am looking through the code again, I am realizing that I am having to completely interpret this mass of code from scratch (since there is no semantically named functions). So its better to break it up now for future understanding.