[MongoMapper] Fixed bug "Undefined variable: pkey"

$pkey was defined after using, also line 229 assume that we never have mongo pkey '_id' on line 232