Fixed lockdir path creation under Windows.

This prevents paths with slashes of the form:
C:\\Parent Directory/locks
to be created under Windows; now all lockdir paths returned by the package will have backslashes only under Windows.

Also, fixed an error regexp checking in a test.