Correct handling of New Project dialog box.

Fixed the bug where if the user enters a bad project name and presses
Enter, goes into infinite loop of alerts.

Change-Id: I78e86dcc7ad987715324606d386891d4d358db23