Fix #37057, Detach (Alt + D) doesn't work in nodes editor / compositor.
The operator exits early when there are no internal links. This prevents it from removing links which have no internal connection.

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk@60742 954f8c5b-7b00-dc11-b283-0030488c597c
Fix for crash from double-freeing in nodes:
The way node groups check for localized trees in the ntreeFreeTree_ex function does not work. When the main library is freed on exit it also frees genuine node groups trees (which is correct), but then
node groups referencing these trees will not find them in the library and interpret that as a localized group, attempting to free them a second time ... Nicer solution is to just use a special flag on
localized node trees so we can clearly distinguish them from genuine trees in main.

git-svn-id: https://svn.blender.org/svnroot/bf-blender/trunk@60743 954f8c5b-7b00-dc11-b283-0030488c597c