Fixed bug where deleteAll tried to delete same id multiple times.

Ensure find done in deleteAll only returns distinct ids. A wacky
combination of association and conditions can sometimes generate
multiple rows per id.
Merge pull request #2421 from ADmad/2.4-bugfix-deleteall

Fixed bug where deleteAll tried to delete same id multiple times.
Cast results of implementedEvents to an array.

This makes using mocks much easier with event listeners as they don't
need to provide a returnValue for implementedEvents.

Refs #2333
Update CakeEventManager.php

Cast resultados de implementedEvents a una matriz.

https://github.com/cakephp/cakephp/commit/e6f2c92005cfb5850159621da182f9b4f327fdd2
Merge pull request #2427 from EliuFlorez/patch-3

Cast implemented events to an array when detaching listeners.

This makes it much simpler to work with mocks, and avoids warnings caused by developer error.
Append / to the start/end of the mapResources prefix.

This makes the method easier to use and less error prone.

Fixes #2431