Fixed  warnings in 64bit mode by casting size_t to int

I got several warnings when compiling in 64bit mode, since size_t is assigned numerous times to int used by the sqlite api.