Make mcrypt input handling stricter

No longer allow invalid IV size, invalid key size or missing IV on modes that require an IV.