Use a mutex rather than a timeout for dealing with race conditions.
Version bump to 0.2.2