[Minor] [Core] Don't NPE on closeQuietly(null)

Author: Aaron Davidson <aaron@databricks.com>

Closes #3166 from aarondav/closeQuietlyer and squashes the following commits:

78096b5 [Aaron Davidson] Don't NPE on closeQuietly(null)

(cherry picked from commit 4af5c7e24455246c61c1f3c22225507e720d721d)
Signed-off-by: Reynold Xin <rxin@databricks.com>