System for detecting malfunctions in insulin delivery devices