The First()-by-machine-key getter returned an undefined node when a machine key mapped to several nodes. It was used only by RegisterNodeForTest; match on (machine_key, user_id) there instead and remove the getter. Updates #3312