Guard scala_library from linking itself as a dep.

In situations where we have a mixed scala-java library we
add the java_library deps into the scala_library during a linking
phase.  This linking was not filtering out the scala_library
itself, leading to a linked cycle.  Fix this and add a unit
test to verify linking semantics.

https://rbcommons.com/s/twitter/r/251/