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.
Merge pull request #1 from bnewbold/master

Fix conditional checks