Fixes bug in formatting element adoption agency algorithm

* As per the whatwg specs [1], further processing of formatting
  elements has to stop if no "furthest block" is found on top of
  the formatting elements.

* This fixes bug in parsing the following snippet:
  "<em>foo<em>bar</em>baz</em>" which would get parsed as:
  "<em>foo<em>bar</em></em>baz"

  Reported as a bug in Parsoid [2]

* All existing tests pass -- new tests required.

[1] http://www.whatwg.org/specs/web-apps/current-work/multipage/tree-construction.html#adoption-agency-algorithm
[2] https://bugzilla.wikimedia.org/show_bug.cgi?id=50604