Thanks for the post. I was having a similar issue with my apple usb keyboard into the usb port on my thunderbolt display, with macbook pro at startup. Generally I would switch usb ports and that worked, but sometimes required unplugging my usb mouse, and switching things around.
I tried what Rustem said in his post and it worked. This may explain what the usb extension cable seems to help as well.
What he says is that the usb connector on the either the Thunderbolt display's contacts or the keyboard are slightly deeper and don't work constantly, and the further he says that the connector for the usb extender is slightly different, with deeper contacts.
To test this, he claims try plugging the keyboard's usb connector in almost, but not all the way in. This worked for me (so far).
The different connector on the usb extension cable may have been resulting in a similar adjustment.