avoid infinite loops on windows.

I don't think obtaining a shared lock is necessary.  Attempting to upgrade a shared lock is also not portable and consistently puts native windows Perl into an infinite loop.  I've also added a timeout so that if for some reason the lock tries to wait forever it won't.