Strip trailing options hash in Open3.popen3 and warn if non-empty.

Fixes #2298.