Fix crash in older versions of Go.
Fix crash in older versions of Go.

It seems that some versions of the io package don't work well with nil
errors.

This change also replaces a link+remove with a single rename call.

ArneBab/pond,saltthefries/pond,infinity0/pond,agl/pond,ioerror/pond,infinity0/pond,sillvan/pond,berkus/pond,agl/pond,berkus/pond,saltthefries/pond,sillvan/pond,ioerror/pond,ArneBab/pond