Fix cannot create new mode due to conflict mode name.

Resolve the issue of 'X Error of failed request: BadName (named color or
font does not exist)'. See http://stackoverflow.com/a/3414850.