PHP-1237: Add extra check for underflow, which theoretically could happen.

Can't find a test case for this though.
Merged pull request #766
Fixed test runner not skipping on 2.6/standalone.
Merged pull request #768
Use %d for ping value, as on Travis it's not always 0.
Merged pull request #767
Do not try to authenticate when no credentials are set.
Set error_message in every case we return 0.
Mark these functions as static, as they are not used outside this file.
Fixed CS issues.