Fixes for dbInsert / dbUpdate queries

This should resolve:

https://github.com/librenms/librenms/issues/220
https://github.com/librenms/librenms/issues/221