Treaties are pieces of paper. They get ignored all the time.
Sure, they get ignored. And ignoring that particular piece of paper would have been an act of war (huge presence of foreign troops in a country against the expressed wishes of that government–pretty much dictionary definition of act of war). Yes, an option available to Obama. A shitty, irresponsible choice that would have needlessly endangered the lives of our soldiers and made conditions in Iraq even worse, but a choice he nevertheless had the option to make. Strangely enough, he didn’t seem to consider it.