OAK-781: Clarify / fix effects of MISSING_NODE as base state of NodeBuilder

Fix the performance issue of a ConnectedHead never actually updating
the head state after a rebase. It would just repeatedly create new
UnconnectedHead instances without ever setting the head field. This
commit makes updating the head field the responsibility of the head()
method, which by centralizing the state transition should help avoid
potential other similar issues.

git-svn-id: https://svn.apache.org/repos/asf/jackrabbit/oak/trunk@1490258 13f79535-47bb-0310-9956-ffa450edef68