SPARK-3926 [CORE] Result of JavaRDD.collectAsMap() is not Serializable

Make JavaPairRDD.collectAsMap result Serializable since Java Maps generally are