TAPFed: Threshold Secure Aggregation for Privacy-Preserving Federated Learning