Fixed Security context not being cleaned up after each execution.
Set Spring Security context mode to THREAD_LOCAL
Fixed order of configuration and cleaning in Spring Security context holder.