Fix #534: Segmentation fault after two bad wal_mode settings

Other changes:

 - "" or NULL=ffi.cast('void *', 0) now resets option to default value
 - app/cfg.test.lua converted to TAP format