Fixed some bugs in ldap-auth/auth-functions.php

Rudimentary session management is now working in index.php, although
we still need to expand session management to deal with multiple failed
login attempts, store users in database, etc.

The header is now in a more correct location, although I'm not really
fond of the way YOURLS handles headers.