rewrite the guts of this module

A lot of what I had done before was based on bad assumptions about
traveling up the path, and that checking for symlinks meant that
I wouldn't cross device boundaries.  Until Perl 6 gets support for
checking inodes and devices, we're gonna make it fall back on
writing a file a lot more often.