remove typecasts on password_callback

Rather than casting password_callback to the correct function pointer
signature at every call site, change it to match the signature instead.