Forward-port of recent spray patches

This PR aggregates a number of patches that we have applied to spray this week.
No preference here.
If the "shutdown before awaitTermination" sequence is the agreed way to go for Akka tests then I'd be happy to put it in.