NREPL-53 regression test
Fix NREPL-53 by rewriting the topological sort

Conflicts:
	src/test/clojure/clojure/tools/nrepl/middleware_test.clj