Avoid crashes in ~ServiceFramework() and ThriftServer::stop()
Avoid crashes in ~ServiceFramework() and ThriftServer::stop()

Summary:
When ##ThriftServer::serve()## throws:
1. the mutex in ServiceFramework were not being locked, resulting in crash during destruction
2. ##ThriftServer::stop()## was crashing;
3. ServiceFramework::cleanupModules() was not being called, resulting in crash during destruction

Test Plan:
fbconfig admarket/adlearner && fbmake opt

Run two instances of _build/opt/admarket/adlearner/learner; verify that
the second one fails to start the server, but still runs cleanly without
SIGABORT on exit.

Reviewed By: davejwatson@fb.com

Subscribers: fbcode-common-diffs@lists, davejwatson, andrewcox, alandau, bmatheny, salex, rfarnham

FB internal diff: D1354248

Orvid/fbthrift,Orvid/fbthrift,jesboat/fbthrift,uber/fbthrift,project-zerus/fbthrift,raphaelamorim/fbthrift,chjp2046/fbthrift,LinusU/fbthrift,HankFaan/fbthrift,raphaelamorim/fbthrift,kangkot/fbthrift,kangkot/fbthrift,LinusU/fbthrift,guker/fbthrift,uber/fbthrift,getyourguide/fbthrift,uber/fbthrift,uber/fbthrift,raphaelamorim/fbthrift,HankFaan/fbthrift,SergeyMakarenko/fbthrift,project-zerus/fbthrift,fengshao0907/fbthrift,guker/fbthrift,sinjar666/fbthrift,chjp2046/fbthrift,sinjar666/fbthrift,kangkot/fbthrift,sinjar666/fbthrift,guker/fbthrift,getyourguide/fbthrift,SergeyMakarenko/fbthrift,raphaelamorim/fbthrift,uber/fbthrift,guker/fbthrift,LinusU/fbthrift,chjp2046/fbthrift,raphaelamorim/fbthrift,soumith/fbthrift,raphaelamorim/fbthrift,facebook/fbthrift,facebook/fbthrift,jesboat/fbthrift,maxwell-demon/fbthrift,jesboat/fbthrift,jesboat/fbthrift,HankFaan/fbthrift,maxwell-demon/fbthrift,chjp2046/fbthrift,kangkot/fbthrift,chjp2046/fbthrift,jesboat/fbthrift,Orvid/fbthrift,kangkot/fbthrift,chjp2046/fbthrift,kangkot/fbthrift,jesboat/fbthrift,soumith/fbthrift,getyourguide/fbthrift,facebook/fbthrift,SergeyMakarenko/fbthrift,soumith/fbthrift,jesboat/fbthrift,fengshao0907/fbthrift,soumith/fbthrift,LinusU/fbthrift,facebook/fbthrift,getyourguide/fbthrift,chjp2046/fbthrift,fengshao0907/fbthrift,Orvid/fbthrift,Orvid/fbthrift,guker/fbthrift,fengshao0907/fbthrift,uber/fbthrift,chjp2046/fbthrift,SergeyMakarenko/fbthrift,maxwell-demon/fbthrift,getyourguide/fbthrift,kangkot/fbthrift,getyourguide/fbthrift,soumith/fbthrift,guker/fbthrift,HankFaan/fbthrift,maxwell-demon/fbthrift,sinjar666/fbthrift,HankFaan/fbthrift,LinusU/fbthrift,sinjar666/fbthrift,maxwell-demon/fbthrift,jesboat/fbthrift,fengshao0907/fbthrift,jesboat/fbthrift,jesboat/fbthrift,maxwell-demon/fbthrift,Orvid/fbthrift,soumith/fbthrift,Orvid/fbthrift,guker/fbthrift,facebook/fbthrift,SergeyMakarenko/fbthrift,Orvid/fbthrift,LinusU/fbthrift,soumith/fbthrift,facebook/fbthrift,HankFaan/fbthrift,fengshao0907/fbthrift,kangkot/fbthrift,Orvid/fbthrift,project-zerus/fbthrift,project-zerus/fbthrift,guker/fbthrift,SergeyMakarenko/fbthrift,project-zerus/fbthrift,LinusU/fbthrift,SergeyMakarenko/fbthrift,guker/fbthrift,kangkot/fbthrift,raphaelamorim/fbthrift,fengshao0907/fbthrift,getyourguide/fbthrift,sinjar666/fbthrift,getyourguide/fbthrift,getyourguide/fbthrift,facebook/fbthrift,facebook/fbthrift,LinusU/fbthrift,fengshao0907/fbthrift,soumith/fbthrift,uber/fbthrift,sinjar666/fbthrift,facebook/fbthrift,HankFaan/fbthrift,LinusU/fbthrift,project-zerus/fbthrift,jesboat/fbthrift,soumith/fbthrift,maxwell-demon/fbthrift,chjp2046/fbthrift,SergeyMakarenko/fbthrift,uber/fbthrift,chjp2046/fbthrift,jesboat/fbthrift,getyourguide/fbthrift,HankFaan/fbthrift,getyourguide/fbthrift,sinjar666/fbthrift,project-zerus/fbthrift,uber/fbthrift,project-zerus/fbthrift,project-zerus/fbthrift,raphaelamorim/fbthrift,uber/fbthrift,Orvid/fbthrift,raphaelamorim/fbthrift,guker/fbthrift,raphaelamorim/fbthrift,chjp2046/fbthrift,guker/fbthrift,maxwell-demon/fbthrift,SergeyMakarenko/fbthrift,project-zerus/fbthrift,SergeyMakarenko/fbthrift,HankFaan/fbthrift,uber/fbthrift,SergeyMakarenko/fbthrift,raphaelamorim/fbthrift,kangkot/fbthrift,HankFaan/fbthrift,fengshao0907/fbthrift,project-zerus/fbthrift,soumith/fbthrift,chjp2046/fbthrift,sinjar666/fbthrift,LinusU/fbthrift,LinusU/fbthrift,fengshao0907/fbthrift,project-zerus/fbthrift,fengshao0907/fbthrift,soumith/fbthrift,maxwell-demon/fbthrift,kangkot/fbthrift,sinjar666/fbthrift,HankFaan/fbthrift,Orvid/fbthrift,SergeyMakarenko/fbthrift,getyourguide/fbthrift,sinjar666/fbthrift,maxwell-demon/fbthrift,maxwell-demon/fbthrift,uber/fbthrift