clear up race condition for was_locked (bug 880013)

is_locked was being called after was_locked when making the object returned
by the api. Instead of trying to fix the API I fixed the race condition on
the model.