Make lib.sh more flexible, and more likely to succeed.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
tmetadata.py: don't look for attr and xattr errors when impossible.

Don't look for the errors when the current (file)system doesn't
support the relevant features.

Thanks to Alexander Barton <alex@barton.de> and Mark J Hewitt
<mjh@idnet.com> for reporting the problem.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>