moved lock to detail::instance_t
Merge pull request #15 from retf/hotfix/issue14

fix for issue 14