Mutex implementation for PHP