MULE-6800: Thread leak on Mule redeployments for embedded

_ Some changes on the log factory classes to enable better testing without involving a big refactoring. Both log factories are creating a LoggerReferenceHandler on the constructor. Wrapping that creation inside a factory method provides a way to override that on the tests. That is not the best approach, but refactoring factories and logger reference handler is out of scope.
(cherry picked from commit ceacd9c)
(cherry picked from commit 6743451)
(cherry picked from commit 6349fa4)