Can't delete a "partially created" lock code

Sounds like the app has a mismatched state which caused during the hang up. You may need to delete the app and reinstall it.
Alternatively you could check out an app like LUM which is much hardier and allows you to change codes as well (amongst a 100 more features) rather having to start over from scratch each time: [RELEASE] Lock User Management (LUM)