Further mitigate race conditions in SIGUSR2 handling. See #798.