chg: restart nanosleep when interrupted by signal
(cherry picked from commit f9efe23dee0924e650e1aefea029b4add8fcc7e9)

Signed-off-by: Andreas Steenpass <steenpass@mathematik.uni-kl.de>