Consistently stat file names or handles.

stat() on Windows reports different device IDs for a file depending
whether it was stat()ed via name or opened handle.  If used
inconsistently, stat() will always report differences.  Discovered by
"pru-mike" at
blogs.perl.org/users/pru-mike/2013/06/creepy-perl-stat-functions-on-windows.html