Fix Memoizer injection (Fix #11934)

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