Restore $! when catching exception.

Hack-ish workaround for [JRUBY-7134](https://jira.codehaus.org/browse/JRUBY-7134) that restores `$!` when an exception is thrown when checking whether the dir exists.

Added also pull request for [rubyspec](https://github.com/rubyspec/rubyspec/pull/191).