MDL-46099 session: fix linking of $USER and $SESSION global

The use of $GLOBALS['USER'] and $GLOBALS['SESSION'] in session
init code instead of lib/setup.php should make the linking
of $USER/$SESSION with $_SESSION more reliable.