A physical lock is used to make something secure. Being "a lock" or having "a lock on" in American English is to be secure about an outcome. Considering all the turmoil during his presidency, Obama is certainly not a lock to win re-election in 2012.
May 13, 2011
lock = whore
But why it is used here, I don't know.