MDL-45843 mod_lti: Use of empty with class method

PHP 5.4 does not like the use of empty with a class method so saved the
value to a variable first.  PHP 5.5 seems to accept the use of a method
with empty.