optimizer: fix crashing bug

A continuation of 22b7cc6a5e: a second old bug in
shift_closure_compilation() than became more exposed.