fstests: sanity check that test partitions are not mounted elsewhere
When $TEST_DEV is mounted at a different location then $TEST_DIR,
_require_test() aborts the test with an error:
TEST_DEV=/dev/sda5 is mounted but not on TEST_DIR=/mnt/test
There are several problems with current sanity check:
1. the output of the error is mixed into out.bad and hard to see
2. the test partition is unmounted at the end of the test regardless
of the fact that it not pass the sanity that we have exclusivity
3. scratch partition has a similar sanity check in _require_scratch(),
but we may not get to it, because $SCRATCH_DEV is unmounted prior
to running the tests (which could unmount another mount point).
To solve all these problems, introduce a helper _check_mounted_on().
It checks if a device is mounted on a given mount point and optionally
checks the mounted fs type.
The sanity checks in _require_scratch() and _require_test() are
converted to use the helper and gain the check for correct fs type.
The helper is used in init_rc() to sanity check both test and scratch
partitions, before tests are run and before $SCRATCH_DEV is unmounted.