Fixed indefinite block on Win32 and possibly other platforms

The mutex protecting the driver registry would be locked
before initialized under certain circumstances, which would
go unnoticed on Un*x (pthreads), but resulted in indefinite
blocking on Win32.

Closes #148.