Use absolute_path of caller_locations to infer engine root

According to documentation `path` only returns file names. On MRI it's
not the case but it's likely a bug in MRI.
Merge pull request #17782 from cheba/engine-root-master

Use absolute_path of caller_locations to infer engine root