The RerunFormatter does not handle failures in background and scenario outline examples correctly

The RerunFormatter does not handle failures in background and scenario outline examples correctly. The use of the line of the failed step works ok in case of ordinary scenarios, but to handle failures in background steps, in examples in scenario outlines and in hooks the line of the scenario needs to be used.