MDL-41419 - unit tests: Fixed up sporadic test failures in externallib_test.php.