Fixed cancel(int id, int timeout) to erase only if event is present