hosts/bsd: only use sudo if we can't write /etc/exports [GH-2643]