How to avoid getting swindled when buying used cranks?
I've actually never seen bent cranks, so that's probably the least of your worries. And if they are bent, then I don't think you'd be able to tell until they're mounted on the bike.

Bringing pedals is a good idea - not to check for straightness, but to check if the pedal threads are damaged. If they're square-taper cranks, you should also check the dust cap threads - if they're messed up, you may not be able to take the cranks off again.