Fix issues with *Execution entities updates during step execution. Refre...

## Fix issues with *Execution entities updates during step execution. Refresh entity state when EM is reopened after fail

It solves following things:
 - SQL errors on PostgreSQL due to reserved keyword
 - Avoid timeout of connection that used for logging of execution process. 

2nd point usually cause errors like "Entity manager is closed", but actually it was another SQL exception f.e. "Mysql has gone away"  due to inactivity 
This code cannot work. An entity that is in STATE_DETACHED cannot be refreshed.
The refresh method will throw an exception.
See https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/UnitOfWork.php#L2082