bail out of retry loop when a signal is received

Signed-off-by: Momchil Atanasov <m.momchil@gmail.com>