blk: only one flag allowed at the time

- clear other flags when setting any flag
- add unit tests

Ref: pmem/issues#4