Tighten the limit on the maximum length of queries

I witnessed gigantic queries causing a slowdown when loading the database via the bootstrap script. This change allowed Dogecoin testnet block 50,057 to be loaded in about 16 seconds, down from 45 minutes.