Fix Memoizer injection (Fix #11934) (rebased onto develop)



This is the same as gh-2021 but rebased onto develop.

----

Once a ctor was added with the same number of arguments,
Spring was incorrectly taking the `${omero...wait}` property
as a string. Casting it first to a Long prevents this.

/cc @ximenesuk @melissalinkert