Fix: clean lock files on Windows.

Closes #2931 and #2909.
Merge remote-tracking branch 'ivan/bug/windows_lockfiles_fix' into develop