Fix the Bash implementation for not ignoring the options specified after arguments.

This was caused by the getopts builtin. Now the regular arguments are processed and removed from the parameter list before getopts is called, so it can parse all of the provided options, regardless of whether they were specified before or after regular arguments.