You have to reset iphone back to factory settings..Making sure to choose option to not backup and restore as then you will find them locked still.Then if you choose to you can then jailbreak.
I had this problem except I knew the code, but it froze and would not let me connect to itunes. What you are going to have to do is reset your ipod, which will make you lose everything, but it will...
Go to "Settings" then go to "General" and scroll down until you see "Passcode Lock" tap this and once entering your passcode you will have the option to disable the passcode.