Fixed return_locals to work when code is profiled with cProfile