JCR-3537: Large number of SQL queries when adding nodes with version history
(patch provided by Todd Pagni)

git-svn-id: https://svn.apache.org/repos/asf/jackrabbit/trunk@1464605 13f79535-47bb-0310-9956-ffa450edef68