Move declaration before TSRMLS_FETCH()
Report the actual timeout used in the timeout error message

This removes duplicated logic for converting negative values to -1000ms (for the timeout and socketTimeoutMS vars). Additionally, we will only calculate rtimeout once before performing our first read (excluding another calculation should we need to revert to socketTimeoutMS at the end of the function).
Increase timeout values in PHP-1158 test
Use a var to track whether we need to revert timeouts after a read
Merge pull request #729