server: catch any panics() and log them as Internal errors

Fixes #4