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