Fix #572 - purge statcollection database to keep the max row defined  

Change the query, and the trigger before purge (1.5 time the max row count will trigger the purge to keep only max row count records).

This should work on any SQLite3 binaries.