Moved li tags inside `optional_login`

as per https://github.com/tomchristie/django-rest-framework/pull/1820#discussion_r16987993