Pre-trained Encoders in Self-Supervised Learning Improve Secure and Privacy-preserving Supervised Learning