Implement getImageSizeFromString()

Open a data stream to get the string as a stream which can be passed to the logic in f_getimagesize(). This logic is moved into a new function

The implementation of getImageSize() and getImageSizeFromString() could be moved to PHP, but I am not sure how to expose the C++ function to PHP land.

Fixes #3801

Test Plan:
run the test runner on
`test/run test/zend/good/ext/gd/`
`test/run test/zend/good/ext/standard/tests/image/`
`test/run slow/ext_gd/`