Fix hash_pbkdf2() with missing $length argument

Also change the type of some string length variables to ensure
that the zpp call works correctly on platforms where sizeof(int)
!= sizeof(long).