[runtime]Add a wrapper around signal handlers to ease porting work.