Tidy up and simplify cmd-pickup.c