The current implementation of VARselect computes AIC as:
criteria[1, i] <- log(sigma.det) + (2/sample) * (i * K^2 + K * detint)
I think this is incorrect as sample is based on the number of rows in the lagged data rather than the number of rows in the original data. As such, if the VAR order is p then sample equals N-p rather than N. The 5th edition of Time Series Analysis by Box and Jenkins shows the AIC formula on page 517 and references N rather than N-p. I also checked New introduction to multiple time series analysis by Luetkepohl (page 208) and that suggests the same conclusion.