server.py: Don't use SOL_TCP

Signed-off-by: Michael Buesch <m@bues.ch>
Simplify Jython-check

Signed-off-by: Michael Buesch <m@bues.ch>
Add workarounds for Jython bugs

Signed-off-by: Michael Buesch <m@bues.ch>