[SPARK-3325][Streaming] Add a parameter to the method print in class DStream

This PR is a fixed version of the original PR #3237 by @watermen and @scwf. 
This adds the ability to specify how many elements to print in `DStream.print`.