It seems farfetched that Akihiko Kayaba would be able to sneak in all that malicious code into Sword Art Online without anyone knowing. Surely it would have been a big project with many developers. Furthermore, it seems like it would be difficult for him stop the other developers from fixing Sword Art Online. Even if he destroyed the source code or something, they still had a whole year to figure something out. Do the light novels shed any more light on Kayaba's scheme?
I've read the Light Novels and it doesn't really cover any more than the anime on how he managed it. And in all honesty, its entirely possible that he was able to slip all that coding in. My father is a programmer so I have a rough idea on how much code goes into a lot of projects and there are actually very few times that people get to view the code as a whole, with each person or group working a small part and then sending it in to add to the bigger project. With this knowledge in hand, being able to work that much code in wouldn't be too far fetched even if Kayaba wasn't top dog, but since he is it is very conceivable that it could happen.
Since Kayaba is known as someone with a high position for the development of the game and the NerveGear, he's probably highly involved with the development and he could have had some backdoor program or an admin level access to the system.
That way he can just remove the Logout option in the database as well as overwrite the program on the nervegear (as it's also connected to the internet via the pc) to fry the player's brain when attempted to be taken off (assuming he hid an extra "feature" in the hardware design that of the nerve gear that could amplify the voltage/ampere).