Ignore saved options when starting gpg-agent. Put agent command at end of options list.
Initialize pins from PINENTRY_USER_DATA. Remember what PIN is being requested and search for it in the user data when GETPIN is called.
Set PINENTRY_USER_DATA based on the decrypt or sign keys when decrypting or signing. Clear the variable when the GPG subprocess ends in the engine.