fix #6033 and #6044

Here's my attempt at a fix. Should be ok but I'll leave it for @loladiro to review.

- trap errors inside timer callbacks
- protect timers from GC
- ignore uv alloc requests when handle->data==NULL