Fix nl2br support for carriage returns.

nl2br() now matches PHP to support prepending of html new lines on carriage returns in addition to newlines.  We also handle special cases when there is a carriage return beside a newline; each pair only get one html new line instead of two.

Fixes #3815