'syncProcess': don't restore handlers before the child finished.

Fixes #1560.