add concurrency lock with shared and exclusive flocks

Signed-off-by: Mattias Andrée <maandree@operamail.com>