Expand this.promiser in file_select exec-attributes

ReplaceStr turns out to be broken. Use SearchAndReplace instead,
with dynamic memory allocation.

Redmine #3530.

Additional improvements in test case.