feat: add an option to open block device with exclusive flock

The problem is the interaction of udevd and our code managing partition
table: udevd might trigger `BLKRRPART` ioctl concurrently with our code
which tries to sync partition table which leads to a mess.

With `flock(LOCK_EX)` udevd skips `BLKRRPART` syscall.

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
(cherry picked from commit b0375e4267fdc6108bd9ff7a5dc97b80cd924b1d)
2 files changed