[bugfix] write failed when pipe is full
[feature] optimize ev_signal handler