Catch WindowsError or OSError.

Closes #128.