Generate privkey in background thread