Fix conditional checks

Many of the parameter checks misbehaved when, eg, write is 0x0000. This is
because 0 evaluates to False in python.

Discovered this when using devmem.py on UIO device files (/dev/uio0),
which is sort of like /dev/mem for users.

(BTW, there also seem to be other problems relating to writes using the command line interface, but I haven't fully debugged them yet)