Make some strlen() calls in OAuth code safe for PHP 8.0
Since PHP 8.0, passing null to strlen() is deprecated.
Thus instead check if a variable (whether string or not)
is null or empty if we do not care about the actual byte
length of a string anyway.
Bug: T343568
Bug: T343840