tests: write tests/failures to build- instead of srcdir

All other test output goes to builddir too and moreover "make distcheck"
complains about writing to it's read-only srcdir.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
tests: return error if failures file not usable

In past this could happen when doing make distcheck.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
build-sys: libmount/python/__init__.py is always a dist file

"make dist" and "make distcheck" should work after a bare
./configure to give us a full featured tar ball.

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
tests: try hard to create swaplabel's test image

Signed-off-by: Ruediger Meier <ruediger.meier@ga-group.nl>
libfdisk: properly implement read-only mode

Don't use fallback to read-only mode in fdisk_context_assign_device(),
it's application responsibility open the device in the right mode.

The commands fdisk and cfdisk check (and report) read-only mode now.

Reported-by: Maciej Małecki <me@mmalecki.com>
Signed-off-by: Karel Zak <kzak@redhat.com>
Merge branch 'master' of https://github.com/rudimeier/util-linux

* 'master' of https://github.com/rudimeier/util-linux:
  tests: try hard to create swaplabel's test image
  build-sys: libmount/python/__init__.py is always a dist file
  tests: return error if failures file not usable
  tests: write tests/failures to build- instead of srcdir