Hmm, maybe a little @tailrec love?

```scala
def terminate() {
  @tailrec def terminateNextChannel(it: JIterator[SelectionKey]) {
    if (it.hasNext) {
      val key = it.next()
      try key.channel.close() catch { 
        case NonFatal(e) => log.error(e, "Error closing channel") 
      }
    }
  }
  try {
    val selector = current
    try terminateNextChannel(selector.keys.iterator)
    finally selector.close()
  } catch {
    case NonFatal(e) => log.error(e, "Error closing selector")
  }
}
```