bump the max key size to 512 bytes. fixes #1714
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
make conditional statement more readable
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.