You might be able to do a factory reset in recovery mode. Not tried it on a locked phone, but worth a go.
Power off the phone. Hold Home and Vol-up keys pressed in, and press and hold power key.
Should reboot into recovery mode.
Use volume up/down keys to select "wipe data/factory reset". Press...