Fix two memory errors in the profiles parser: an invalid read and a
"source and destination overlap in strncpy" warning.
When the profiles page is initialized it fetches the profile names from
the profiles file. When a profile wasn't defined in the file, the parser
made invalid reads outside the buffer.
Signed-off-by: Andreas Persson <andreasp56@outlook.com>