extended spawnWithPty to return a ProcessHandle

Also updated `ptywrap` to properly forward error codes. This uses `Data.Coerce` which is base 4.7+ can be avoided if necessary