Create a TimedTry helper function for simple locks.

This will be used until (if) we ever decide to implement our own lock primitives with proper timed try functionality.

BUG=
R=sebmarchand@chromium.org

Review URL: https://codereview.appspot.com/147680043