Refactor quota checker trigger function

- Ported to pl/pgsql (#173)
- Trigger function code moved to lib/sql (#899)
- Never allow insert or update operations while overquota
- Check quota every 0.1% of row insert/update operation

Run rake cartodb:db:update_test_quota_trigger to upgrade