Merge pull request #591 from Masterminds/fix/590

Fixed #590: When exit signal recieved remove global lock