Avoid setting lock TTL for infinity.

For 1 second $grace_ttl expression (int)(1/2) equals 0. In Memcache if TTL is 0 then cache item never expires.