Fix checking of NULL or empty OC::$THIRDPARTYROOT/OC::$THIRDPARTYWEBROOT

Fixes #10065

See issue for details.
Empty is not a function but a language construction like `echo`
Not sure about static members but empty called on non-static member causes failure:
empty($this->something);
will fail with parse error.