shutdown bg threads gracefully; closes #68