Port fixes for EXIF bugs from PHP

Official fixes PHP bugs 60150 and 65873, plus extra line breaks. This is
just to be prudent, I haven't found an actual security vulnerability in
HHVM. In the case of 65873, reproduction depends on allocator details,
and HHVM's allocator is probably not vulnerable at present.

Submitted on behalf of a third-party: The PHP Group
Source: http://svn.php.net/viewvc/?view=revision&revision=319534
Source: https://github.com/php/php-src/commit/cbcf6e1880e35ed7cd052e127b037eee7cef61c9
License: version 3.01 of the PHP license

Closes: #1154