More robust error handling with close() and assertions

Timer file descriptor is closed if it event machine fails to add it.