setup: Fix bug with strdup() of NULL pointer.

getenv() can return NULL if the environment variable is not set, but
the result of getenv() was always being passed to M_StringDuplicate()
without any check. This could cause crashes on some platforms.
Instead, rework the code into a first stage that gets the player's
name and a second that duplicates it into a mutable form.

This fixes #455.