Convert pid using Integer()

rescue and return nil if ArgumentError(non numeric) or TypeError(nil
value) is raised.