tlp-functions, poweroff_drivebay(): fix $syspath

Prior to this patch, poweroff_drivebay() did the following:

>> syspath="/sys$($UDEVADM info ... | perl -pe 's!/block/...$!!')"
>> ...
>> [ -n "$syspath" ] && echo 1 > $syspath/delete

This leads to two issues:

(1) $syspath is never empty ("/sys"), so the -n check always succeeds
    Unlikely case, because the function checks for existence of the
    optical drive, but it could end up trying to write /sys/delete
    if udevadm fails for whatever reason.

(2) the perl regex assumes that the name of $optdrv ($BAY_DEVICE)
    is exactly 3 chars long, else the path returned from udevadm is left
    unchanged -- e.g. if BAY_DEVICE is set to "sr10".
    Again, unlikely case.

The 'obvious' solution for issue (a) is:

>> [ -n "${syspath#/sys}" ]

and for (b):

>> syspath="/sys$($UDEVADM info ... | perl -pe 's!/block/[^/]*[^/]$!!')"

(drop /block/<name>, and <name> must not contain "/" chars)

This commit, however, proposes a different solution:

* check for udevadm's return code and don't touch $syspath/delete if it fails

* use shell builtins instead of the perl command
   In constrast to the (changed) regex, it _will_ remove subpaths at the end of
   the syspath str (".../block/a/b" => "...").
   Alternatively, "sed -e" would be identical to "perl -pe" here.

This removes the dependency on perl from tlp-functions,
which means that, under certain circumstances (i.e. no tpacpi-bat needed),
tlp (but not tlp-stat) _could_ be run without perl.