Fixed locks and changed the lock in `frame_stack_chunk`.

Also possibly fixed `push_chunk`.