script: use poll() rather then O_NONBLOCK

The hack with O_NONBLOCK is not reliable, poll is really better way to
wait for data.

This is backport from master branch to v2.24.1.

Signed-off-by: Karel Zak <kzak@redhat.com>
mkswap: fix compiler warning [-Wunused-variable]

Signed-off-by: Karel Zak <kzak@redhat.com>
build-sys: fstrim depends on libmount

Signed-off-by: Karel Zak <kzak@redhat.com>
tests: update build-sys tests

Signed-off-by: Karel Zak <kzak@redhat.com>