(#9996) Restore functionality for multi-line commands in exec resources
Originally we were relying on the behavior that Array.new would call
#to_a on its argument, which is a no-op if the object is already an
array. When #to_a is called on a string, it does not always return
[original_string]. Because string.to_a is effectively equivalent to
string.each_line.to_a (at least in Ruby 1.8.7) we were breaking
commands with embedded newlines.
Manually wrapping the passed in command in an array, and calling
#flatten is much safer since it will not "helpfully" split up the
command string for us.