bump the max key size to 512 bytes
enforce the max key size with a runtime check
fix whitespace
add test for long database key
include sys/stat.h to fix warning on gcc 4.7
fix ./configure --with-sqlcipher when libsqlcipher is auto-detected

Running ./configure would work fine, but ./configure --with-sqlcipher would
fail.  I had the logic a bit backwards.