I bought my iPhone 4S a year ago before Apple officially started selling "unlocked" models. It was just the same as any AT&T model, and I paid full price for it, so they just handed it to me, still sealed.
As far as I can tell, the actual locking of a phone to AT&T doesn't happen until Apple locks the phone during the AT&T registration process in the store. This process does NOT happen if you just stick in a random SIM from another carrier (or a current AT&T SIM).
SIM locking doesn't make any sense in the United States anyway, as there are almost no phones that can be moved from one carrier to another and get full functionality because of the different frequency bands used (and the fact that Verizon and Sprint don't allow phones on their network that weren't originally provisioned by them with the MEID in their system).