The easiest is to kill them from the shell, e.g.
mysqladmin proc | grep Sleep | awk '{print $2}' | xargs -L1 mysqladmin kill
If there is still a problem, check the details by the following query:
mysql -e "SHOW engine innodb status\G"
From MySQL, try the following code based on the post by @Shlomi, you can create a stored procedure using server cursor, for example:
DELIMITER $$
DROP PROCEDURE IF EXISTS test.kill_user_queries$$
CREATE PROCEDURE test.kill_user_queries (kill_user_name VARCHAR(16) CHARSET utf8)
SQL SECURITY INVOKER
BEGIN
DECLARE query_id INT;
DECLARE iteration_complete INT DEFAULT 0;
DECLARE select_cursor CURSOR FOR SELECT id FROM INFORMATION_SCHEMA.PROCESSLIST WHERE user=kill_user_name;
DECLARE CONTINUE HANDLER FOR NOT FOUND SET iteration_complete=1;
OPEN select_cursor;
cursor_loop: LOOP
FETCH select_cursor INTO query_id;
IF iteration_complete THEN
LEAVE cursor_loop;
END IF;
KILL QUERY query_id;
END LOOP;
CLOSE select_cursor;
END$$
DELIMITER ;
There is also an old script called mypgrep.py
by Google.