Fixed Bug #64962 	imagerotate produce corrupted image

See https://bitbucket.org/libgd/gd-libgd/issue/67/problem-with-gdrotate

This computation need to be done in signed range.
Merge branch 'PHP-5.5'

* PHP-5.5:
  Fixed Bug #64962 	imagerotate produce corrupted image