Ensure command line arguments that get copied to heap are only assigned once

Some command line arguments get copied to the heap, and if assigned more
than once will leak heap memory. A malicious user could use this to
write known data to the heap, so prevent multiple assignments of these
arguments. This is not a security issue by itself, but might make
attacks easier if there were one.