testwatcher: protect against invalid EWD_SECS value

Signed-off-by: Jiri Jaburek <jjaburek@redhat.com>
add rlWait

since the bash builtin `wait' command does not provide any kind of
timeout, we need to wrap it around a method that will allow
for killing the process we wait for

this does not duplicate functionality of rlWatchdog, as it does
use wait builtin and returns the background command exit code

allows to remove some code duplication in __INTERNAL_wait_for_cmd()

Signed-off-by: Hubert Kario <hkario@redhat.com>
rlWaitForSocket - add waiting for socket closure

Add ability to wait for the socket to stop listening.

Signed-off-by: Hubert Kario <hkario@redhat.com>
rlServiceStart: Start even when stop failed

BZ#615291

rlServiceStart stops the service when it is running at the time of
running. Previously, it did not start the service when this stop failed.
Now it tries to start the service in this case. It still returns non-0
RC and warns about the failure.
More quotes && provide new internal check

__INTERNAL_rlRunsInBeaker: Returns 0 if the test is detected to be
running in Beaker automated job.