Interface for file descriptor open/close hooks + port to thread-Unix.