fix bug with pthread deadlock in when early termination is used
adjust spacing to match existing code
Merge pull request #208 from agrubb/bugfix-early-terminate-deadlock

fix bug with pthread deadlock when early termination is used