Scala: improved shut down