better file descriptor management for alarm threads