[SPARK-4882] Register PythonBroadcast with Kryo so that PySpark works with KryoSerializer

This PR fixes an issue where PySpark broadcast variables caused NullPointerExceptions if KryoSerializer was used.  The fix is to register PythonBroadcast with Kryo so that it's deserialized with a KryoJavaSerializer.

Author: Josh Rosen <joshrosen@databricks.com>

Closes #3831 from JoshRosen/SPARK-4882 and squashes the following commits:

0466c7a [Josh Rosen] Register PythonBroadcast with Kryo.
d5b409f [Josh Rosen] Enable registrationRequired, which would have caught this bug.
069d8a7 [Josh Rosen] Add failing test for SPARK-4882

(cherry picked from commit efa80a531ecd485f6cf0cdc24ffa42ba17eea46d)
Signed-off-by: Josh Rosen <joshrosen@databricks.com>
Revert "[SPARK-4882] Register PythonBroadcast with Kryo so that PySpark works with KryoSerializer"

This reverts commit 822a0b42f79acea2771d0b298e803c11c37aab81.

This fix does not apply to branch-1.1 or branch-1.0, since PythonBroadcast
is new in 1.2.
[SPARK-4813][Streaming] Fix the issue that ContextWaiter didn't handle 'spurious wakeup'

Used `Condition` to rewrite `ContextWaiter` because it provides a convenient API `awaitNanos` for timeout.

Author: zsxwing <zsxwing@gmail.com>

Closes #3661 from zsxwing/SPARK-4813 and squashes the following commits:

52247f5 [zsxwing] Add explicit unit type
be42bcf [zsxwing] Update as per review suggestion
e06bd4f [zsxwing] Fix the issue that ContextWaiter didn't handle 'spurious wakeup'

(cherry picked from commit 6a897829444e2ef273586511f93a40d36e64fb0b)
Signed-off-by: Tathagata Das <tathagata.das1565@gmail.com>