Split lock and try_lock into mutex and range overloads without using enable_if, so it works on Borland compilers