SI-6961 maintain structural sharing in list serialization.

Applying Jan Vanek's patch that makes list serialization maintain
structural sharing, as well as avoids a stack overflow for big lists.
See a more detailed explanation in the bugtracker.

Additionally, deserialization of lists serialized with Scala 2.10.1
and 2.9.x should work.
This legacy deserialization is embodied in the methods `readObject_2_10_0`
and `readObject_2_9_x`.

Factored out setting and resetting of the SerializeControl instance
into the companion object, using @inline to eliminate the closure.

This is a PR 1923 resubmitted, squashed:
https://github.com/scala/scala/pull/1923