when using -x to stop at filesystem boundaries, include the mount
points but not their contents.
I did this by calling stat() on the directory above the current
directory and checking to see if it has the correct st_dev. Hopefully
this will work for most systems.
Note that the permissions and ownership on the mount point cannot be
copied correctly as they are unavailable while the filesystem is
mounted. Instead rsync will set the permissions and ownership to those
of the root directory of the mounted filesystem (ie. the apparent
permissions/ownership of the directory)