Clean up UDP code more and migrate creds files.

Untested, but this should work better. Be careful about leaking file descriptors; this is what dynamic-wind is for.