Avoid opening two transactions per single request REST transaction

This introduces caching of PreparedQueries in ExecutionEngine.  The cache adds a tiny overhead for all calls to execute/profile
but this is much less than opening two transaction just to check if a query isPeriodicCommit.

While it would be possible to tie the prepared queries cache and the plan cache together, this would complicate matters
with plan cache flushing, hence we don't do that for now.

Signed-off-by: Jakub Wieczorek <jakub@neotechnology.com>