Serialize figure-captions in non-sol state to prevent RT errors.

* Figure captions are not in a Start-Of-Line (SOL) in wikitext,
  so they have to serialized in non-sol state as well.  Without
  this, captions that have wikitext-like-chars in the sol-position
  will get nowiki-escaped. For example,

  [[File:foo.jpg|thumb| bar]] will get serialized to:
  [[File:foo.jpg|thumb|<nowiki> bar</nowiki>]]

* This is a bug that crept in with a switch from token-based
  serialization handlers to DOM-based handlers in 8939c692. But, the
  bug was hidden because of two reasons. We didn't have parser tests
  to cover this scenario. But, wikitext above wasn't getting parsed
  to figure-tags because of bugs from 6e4ef20e that tackled i18n.
  This i18n bug was fixed in 54695ae3 which exposed the figure
  serialization bug in RT-testing.

* This patch fixes the original bug.

* No change in parser test results.  TODO: Add new ones.

* Unrelated fixes:
  - Removed stale 'emitNewlineOnNextToken' property from serializer
    state which has since been refactored to make this unnecessary.

Change-Id: Iaa111628dd3d30118d85837a138fe10ff3d2e325
Merge "Serialize figure-captions in non-sol state to prevent RT errors."