Fix ref before assignment in webapp/nodes/whoami.

Now returns 404 instead of 500 for an unknown node_id.
Merge pull request #504 from hughsaunders/sprint

Merged automatically by jenkins after successful gate test