Fix a race condition in the Patcher

Thanks Sam Perman for your feedback and support.
adjust tests
bump version and update changelog